Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torznab API result sort order #185

Open
2 tasks done
ioqy opened this issue Feb 27, 2024 · 4 comments
Open
2 tasks done

Torznab API result sort order #185

ioqy opened this issue Feb 27, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ioqy
Copy link

ioqy commented Feb 27, 2024

  • I have checked the existing issues to avoid duplicates
  • I have redacted any info hashes and content metadata from any logs or screenshots attached to this issue

Is your feature request related to a problem? Please describe

I noticed that Sonarr is only ever requesting a single page from Bitmagnet when performing a normal RSS sync, and therefore doesn't find anthing.

From the code of Sonarr it looks like Sonarr stops requesting further results from the Indexer when the oldest publishDate is older than the publishDate of the previous RSS sync.

The query that Sonarr performs for a RSS sync is /torznab/?t=tvsearch&cat=5000,5030,5040,5045&extended=1&offset=0&limit=100.

As far as I can see, the result of Bitmagnets /torznab endpoint has no sort order and the pubDate can contain wildly different dates. I have seen dates ranging from 2019 to 2024 in a single query. The result also doesn't seem to be the latest torrents from the web UI.

Describe the solution you'd like

I couldn't find anything regarding a default sort order or any recommendations on the sort order in the Torznab specifications. But to me it looks like Sonarr expects that querying the /torznab endpoint would return the latest torrents in descending order. So the first item would be the last updated/added torrent in Bitmagnet. Otherwise the RSS sync of Sonarr can't work properly (I think).

Additional context

A sidenote: I have also seen that the channel contains a pubDate and lastBuildDate, both of which have Mon, 01 Jan 0001 00:00:00 +0000 as a value and I couldn't find both of these fields in the Torznab specification for the channel. I don't know if Sonarr or Radarr is using these fields, but they don't look right to me.

@ioqy ioqy added the enhancement New feature or request label Feb 27, 2024
@Send8213
Copy link

Those extra channel elements appear to be part of the RSS spec, rather than the Torznab or Newznab specs:
https://cyber.harvard.edu/rss/rss.html#optionalChannelElements

channel / pubdate:

The publication date for the content in the channel. For example, the New York Times publishes on a daily basis, the publication date flips once every 24 hours. That's when the pubDate of the channel changes. All date-times in RSS conform to the Date and Time Specification of RFC 822, with the exception that the year may be expressed with two characters or four characters (four preferred).

channel / lastBuildDate:

lastBuildDate The last time the content of the channel changed.

It doesn't look like either is being set properly though.

@Send8213
Copy link

Regarding the torznab results order, it does appear to be using the latest found torrents internally. You can turn off the DHT crawler and the results in the web UI and the Torznab query should then eventually match once it's finished processing what it has, as long as nothing new is being added.

@binhex
Copy link

binhex commented Sep 19, 2024

Regarding the torznab results order, it does appear to be using the latest found torrents internally.

I don't believe it is, from my findings its using the sort order 'Relevance' not 'Published' date.

@ioqy If you are still interested then check out my PR for the details:- #308

@ioqy
Copy link
Author

ioqy commented Sep 19, 2024

@binhex Thank you for the PR. Let's hope that will get merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants