Skip to content

Add the original info URL to the release object stored for Newznab/Torznab search results#12207

Open
juandjara wants to merge 1 commit into
pymedusa:developfrom
juandjara:feature/plumb-info-url
Open

Add the original info URL to the release object stored for Newznab/Torznab search results#12207
juandjara wants to merge 1 commit into
pymedusa:developfrom
juandjara:feature/plumb-info-url

Conversation

@juandjara

Copy link
Copy Markdown

Hi team! I wanted to contribute this feature I have created while working on my alternative React-based client for Medusa.

Motivation

When picking between candidates in a manual search, users often want to open a release on the indexer's site to check the file list or see bundled subtitles. Today Medusa exposes only the download URL on cached results, so a frontend can let you snatch a release but not preview it.

This information is already available to use: Newznab and Torznab XML responses include a <comments> element pointing to the release's info page.

I considered recovering the URL on the frontend by rewriting the download URL or querying the configured Prowlarr server at /api/v1/search but the solution would be sub-optimal and end up as a half-assed fix rather than a good feature. Plumbing <comments> through the API to the DB is the smallest change with the broadest reach: every Newznab/Torznab provider gets a real per-release info link with no extra requests.

Changes

A new info_url follows the same path url does today:

  • SearchResult (medusa/classes.py) gains an info_url attribute, populated from the parser on live results and from the cache row on reload.
  • GenericProvider._get_info_url reads item['info_url'] by default — any provider whose parse() adds that key gets piped through automatically.
  • Newznab and Torznab parsers extract <comments> into the item dict.
  • Provider cache table (medusa/tv/cache.py) gains an info_url TEXT column. New installs get it from CREATE TABLE; existing tables pick it up via the same auto-add-column loop
    already handling release_group, proper_tags, etc. — no DB migration version bump. INSERT/UPDATE persist it alongside url.
  • /api/v2/providers/<id>/results exposes the field as infoUrl, returning null for rows written before the column existed so consumers fall back gracefully.

Test plan

  • Confirmed the column is added on new installs and via the auto-migration loop on existing ones.
  • Manual searches against a Newznab and a Prowlarr-fronted indexer both populate info_url; the Prowlarr-fronted case points to the upstream tracker domain, not the Prowlarr host.
  • Pre-migration cache rows return infoUrl: null without errors.

No existing issue tracking this but happy to file one if the maintainers would prefer a reference

  • PR is based on the DEVELOP branch
  • Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
  • Read the contribution guide

…wznab/Torznab search results and expose this in the providers API

You can get this information from the XML of Newznab and Torznab responses, using the <comments> element. This is useful to inspect the details of the release you are grabbing when doing manual episode searches.
@juandjara juandjara changed the title Add the original info URL to the release object in data stored for Newznab/Torznab search results Add the original info URL to the release object stored for Newznab/Torznab search results May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant