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

Reimplement Search subsystem #15126

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

glassez
Copy link
Member

@glassez glassez commented Jun 26, 2021

New Search subsystem uses external Torznab indexers.
Ref.: qbittorrent/search-plugins#121

@glassez glassez added the Search engine Issues related to the search engine/search plugins functionality label Jun 26, 2021
@glassez glassez added this to the 4.4.0 milestone Jun 26, 2021
@glassez glassez requested a review from ngosang June 26, 2021 12:04
@glassez glassez force-pushed the torznab branch 2 times, most recently from 33b4785 to 121477e Compare June 28, 2021 04:10
Copy link
Member

@ngosang ngosang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I tested it in Windows and it's working well but a few things. You can merge it after solving these issues. About code review, I thing there are more capable contributors. Just search for "python" or "py" in the whole project to be sure you don't forget dead code.

Issues:

  • Size parsing is wrong. I see "unknown" in most results. Try searching movies or something larger than 10 GB
  • If some indexer is not working there is no way to known. Print some error traces at least.
  • If I disable all indexers the search never stops. Maybe add a check for that.
  • If I delete 1 indexer the list is not updated. If I delete the same indexer again qBittorrent crashes.
  • If I delete all indexers, close the indexers dialog and search for something the search never stops.

Improvements:

  • Empty search in available in Torznab. It returns newest torrents and it's useful. Just remove the check.
  • Indexers can't be edited. This is really useful because the Jackett API key and IP can change. You can reuse the "add" form, it should be easy.
  • I have more improvements in mind but they can wait.

@glassez
Copy link
Member Author

glassez commented Jul 3, 2021

@ngosang
Thank you for the review and testing. Some of the mentioned disadvantages are known to me (I just haven't finished this job yet). I'll deal with the rest later, too.
The main thing is that in general it is acceptable.

@glassez
Copy link
Member Author

glassez commented Jul 6, 2021

Size parsing is wrong. I see "unknown" in most results. Try searching movies o

Does Torznab provide some predefined size format to be returned by each indexer?

@glassez
Copy link
Member Author

glassez commented Jul 6, 2021

If some indexer is not working there is no way to known. Print some error traces at least.

I've been thinking about error handling, but I haven't come to a decision yet. If all the indexer requests are failed, then we can just show the failed status. But what if only some of the indexers failed, and the rest returned the expected result?

@ngosang
Copy link
Member

ngosang commented Jul 7, 2021

Does Torznab provide some predefined size format to be returned by each indexer?

All indexers follow the Torznab specs. There is a field called size with the value in bytes. Bear in mind this number can be huge. For example => 22987506683 (~21GB)

But what if only some of the indexers failed, and the rest returned the expected result?

  1. I think it's a good idea to show error or warning traces in all cases.
  2. We can use the status bar (bottom) to show total results and failing indexers. The user can check the traces for error details.
  3. In the proposal => qBittorrent.pdf I suggested a button for testing all the indexers but I think it can be implemented later.

@glassez
Copy link
Member Author

glassez commented Jul 7, 2021

I think it's a good idea to show error or warning traces in all cases.

How should we show them? Just add messages to a log?

We can use the status bar (bottom) to show total results and failing indexers.

I'm not sure I can imagine what it might look like (sorry, I'm weak in UI design). In addition, it should be presented in such a way that it does not confuse when the Search tab is not current.

@glassez
Copy link
Member Author

glassez commented Jul 17, 2021

  • Size parsing is wrong. I see "unknown" in most results. Try searching movies or something larger than 10 GB
  • If I disable all indexers the search never stops. Maybe add a check for that.
  • If I delete 1 indexer the list is not updated. If I delete the same indexer again qBittorrent crashes.
  • If I delete all indexers, close the indexers dialog and search for something the search never stops.
  • Empty search in available in Torznab. It returns newest torrents and it's useful. Just remove the check.
  • Indexers can't be edited. This is really useful because the Jackett API key and IP can change. You can reuse the "add" form, it should be easy.

Should be fixed now. Please test again.

TODO:

  • If some indexer is not working there is no way to known. Print some error traces at least.

@glassez glassez force-pushed the torznab branch 4 times, most recently from 3ca672c to a6579eb Compare July 18, 2021 11:04
@glassez glassez requested a review from a team July 20, 2021 11:34
@thalieht
Copy link
Contributor

First time jackett user here so excuse me if i say something stupid.

Indexers can't be edited. This is really useful because the Jackett API key and IP can change.

Some people will have many indexers. We'll need a way to bulk update them.

@glassez
Copy link
Member Author

glassez commented Jul 21, 2021

@thalieht
It seems that all your comments come from the false assumption that this is an implementation of Jackett support. This is not true. I never wanted to get attached to Jackett only, so this can be considered as support for any Torznab-compliant search engine.

@ngosang
Copy link
Member

ngosang commented Jul 22, 2021

Should be fixed now. Please test again.

Sorry, I can't in the next weeks but it should be fine.

If some indexer is not working there is no way to known. Print some error traces at least.

Print error traces in the log, the "advanced" user will be able to see them in the log tab and that is enough to close related issues. About more "visible" message I don't have better ideas. 1) Warning icon in the search tab with a tooltip to check the log. 2) Same message in the status bar. 3) Add a search result with the error in the "torrent name". Eg: The indexer XXX is not working because: XXX. That result is fake and can't be downloaded. For the me urgent is the log message. This could be improved later.

It seems that all your comments come from the false assumption that this is an implementation of Jackett support. This is not true. I never wanted to get attached to Jackett only, so this can be considered as support for any Torznab-compliant search engine.

True. The current implementation is more generic and it's not coupled to Jackett.

Some people will have many indexers. We'll need a way to bulk update them.

This will be a nice enhancement but it can be implemented later. I prefer to merge this as is and the search feature will be improve over the time with small PRs.

@glassez
Copy link
Member Author

glassez commented Jul 23, 2021

Print error traces in the log

It's done currently (within latest changes).

@Chocobo1
Copy link
Member

Maybe we should announce deprecation (in UI) of the old search engine first before dropping it entirely? A notice in log when old search is enabled and renaming the old search to Search (obsolete) would suffice. The new search would take over the name of Search.

@ngosang
Copy link
Member

ngosang commented Jul 27, 2021

I prefer to drop support completely in 4.4.0 release. It will affect a lot of users but, since the decision is made there is no point in delaying. I can do intensive QA this weekend to be sure it's good enough in the first release so users don't have to go back.

You should add a big breaking change notice in the changelog. The users can stay in version 4.3.x for a while until they update. I will add a notice in the search-engine plugin repository too.

@glassez
Copy link
Member Author

glassez commented Jul 27, 2021

However, the problem is that WebAPI/WebUI have not yet been adapted.
Maybe I will have time to provide WebAPI for a new Search engine, but it is unlikely that I will be able to adapt WebUI. To be honest, I wouldn't want to have anything to do with WebUI at all. But I'm afraid that this PR will be blocked until WebUI follows it (it really pisses me off).

@FranciscoPombal
Copy link
Member

@glassez

But I'm afraid that this PR will be blocked until WebUI follows it (it really pisses me off).

This PR need not be blocked, just the 4.4.0 release, pending the WebUI implementation.

@glassez
Copy link
Member Author

glassez commented Jul 27, 2021

But I'm afraid that this PR will be blocked until WebUI follows it (it really pisses me off).

This PR need not be blocked, just the 4.4.0 release, pending the WebUI implementation.

IMO, it is unacceptable to block a release while waiting for changes that do not have an ETA.

@FranciscoPombal
Copy link
Member

@glassez

IMO, it is unacceptable to block a release while waiting for changes that do not have an ETA.

There is no obligation to make a major feature release until it's 100% ready.

I'm just saying that while it is an option to release the new search subsystem without a WebUI implementation, it is also an option to delay a release that includes the new search subsystem until there is one. IMO this is completely up to you, I'm fine with the decision either way (although in a perfect world, my preference would be that the release already includes the WebUI implementation).

@glassez
Copy link
Member Author

glassez commented Jul 28, 2021

There is no obligation to make a major feature release until it's 100% ready.

My opinion about "WebUI feature parity requirements" has not changed for years. We should not require it until we have an active web developer in the team, otherwise it hinders the development of the application. WebUI is not an integral part of the application for me, but just an external client application (although officially distributed as built-in).

But if the opinion of the community is that absence of "WebUI feature parity" should block the release, I would prefer not to merge it at all until someone adds WebUI implementation on top of this PR. Please be content with unsupported "rotting" feature, if WebUI is more important to you.

@glassez
Copy link
Member Author

glassez commented Jan 11, 2022

@ngosang Would those indexers handle rss feeds as well? I mean would it be possible for the indexers to replace/substitute the rss feature in qbt?

But they are different kind of features with different purposes. Search - to find a specific torrent purposely. RSS - for tracking news/updates of some sources /trackers and (optionally) autoloading new torrents based on some filtering rules. IIRC, Torznab indexes (at least provided by Jackett) can be used as RSS feeds by qBittorrent RSS subsystem.
Have you any detailed idea of how they can be integrated?

@glassez
Copy link
Member Author

glassez commented Jan 11, 2022

To be honest, I can imagine a backlash from the users if it changed without fore communication.
I don't mind it being included in the next release (4.5.0 for now) but I think users would need time to be prepared for the change, that is, the wiki help page for setting up the new system must be ready and there should be a deprecation warning when users enabled the current search system (in qbt log and in plugin repo/wiki pages, with both giving links to the aforementioned wiki page).

Sounds reasonable.
@ngosang
Can you deal with it?

@ngosang
Copy link
Member

ngosang commented Jan 11, 2022

To be honest, I can imagine a backlash from the users if it changed without fore communication.
I don't mind it being included in the next release (4.5.0 for now) but I think users would need time to be prepared for the change, that is, the wiki help page for setting up the new system must be ready and there should be a deprecation warning when users enabled the current search system (in qbt log and in plugin repo/wiki pages, with both giving links to the aforementioned wiki page).

Yes.

  • I will write the Wiki article ASAP (probably this week). It will contain all the details about the deprecation. migration, configuration, recommenced Torznab apps... I will post the Wiki link here when it's complete so you can add the Link in the qBittorrent UI.
  • I can manage deprecation notices and complains in https://github.com/qbittorrent/search-plugins Other places like this repository or the official website are your thing.
  • I don't have access to create new pages or edit the Wiki. Could you give me temporal access?
  • I also would like to know an approximate date for the release. To do final testing, update the deprecation notice and pay attention to the related issues.

Would those indexers handle rss feeds as well? I mean would it be possible for the indexers to replace/substitute the rss feature in qbt?

For now we should keep Search and RSS feature as different things. Doing more changes will delay this integration.

Long answer:
Torznab API is compatible with RSS. That means you can put the Torznab URL in any RSS client and it should work as expected. In qBittorrent RSS too.
The "text search parameter" is optional in Torznab specs. If that field is empty or not defined, the Torznab API must return the list of latest/newest torrents. So, you can add the Torznab URL to any RSS client to discover new torrents.
Well know software like Sonarr/Radarr/Lidarr use that "new torrents RSS feed" to find new releases.
Example: Imagine you have a list of 100 movies you want to download (but they are not available yet because they are in theatres). You have to query the Torznab API periodically to check if the movie is available to download.

  • You can make 100 queries searching for the movie name.
  • You can make 1 request with empty text search, you get the latest releases and you search the 100 missing movies in that list. Radarr uses that method (called RSS in Radarr UI). Jackett and other Torznab providers have caching methods to speed up empty search.

The Torznab feed used for the Search Engine (this PR) can be used as RSS with the same configuration. In future releases we can use that Torznab config to "auto configure" RSS feeds. Or some kind of "auto download" feature based on RSS feeds. For now, the user can copy the Torznab URL 2 times. In Jackett you have 2 different buttons for Torznab/RSS to make it clear but it copies the same URL :)
image

@Chocobo1
Copy link
Member

I don't have access to create new pages or edit the Wiki. Could you give me temporal access?

I suppose you meant this repo wiki, only @sledgehammer999 can help with that.

I also would like to know an approximate date for the release. To do final testing, update the deprecation notice and pay attention to the related issues.

It is hard to estimate, I would say about this year summer but it might be sooner or even later..

For now we should keep Search and RSS feature as different things. Doing more changes will delay this integration.

Of course, I was just imagining deeper integration since I know little of the indexer.

@glassez
Copy link
Member Author

glassez commented Jan 12, 2022

Guys, what would a deprecation notice look like in GUI?

@Chocobo1
Copy link
Member

Chocobo1 commented Jan 12, 2022

Guys, what would a deprecation notice look like in GUI?

For me, an warning (nobody would notice info message level) in log would suffice...
Or you can add it in search plugin dialog, probably near the buttons.

@glassez
Copy link
Member Author

glassez commented Jan 12, 2022

For me, an warning (nobody would notice info message level) in log would suffice...

Seems many users have no idea about the existence of the Log.

Or you can add it in search plugin dialog, probably near the buttons.

Here it can also go unnoticed if someone rarely changes/adds plugins. Maybe add it to the main interface of the Search Engine?

@ngosang
Copy link
Member

ngosang commented Jan 23, 2022

Documentation => https://github.com/qbittorrent/search-plugins/wiki/New-Torznab-search-engine
Screenshots => https://github.com/qbittorrent/search-plugins/tree/master/docs

You should move both to the Wiki of this repository. I don't have access.
I think this is all from my side. If you need anything else I will try to help. Please don't delay these changes too long.

@glassez
Copy link
Member Author

glassez commented Jan 31, 2022

Damn, I really don't have time to do this job. @qbittorrent/frequent-contributors, @qbittorrent/bug-handlers, @jagannatharjun, maybe someone can proceed with it?

@Obegg
Copy link

Obegg commented Feb 25, 2022

As an end-user, if I understand correctly - I have to add each one of the indexers to qbittorrent, manually, one by one.
But what if you have too many? Is there no option/solution to copy all added indexers and paste them into qbittorrent?
I'm sure I'm not the only one who will be bothered by doing them one by one.
If there's no option, at least provide us (the end-users) with a guide of how to copy all indexers, one way to get all indexers from Jackett's web-ui is to right-click and view the page source and somehow from there do something.

TL:DR:
Make it simple to transition from the current method of search (Python) to the next method of search (Torznab).
Or I should say - Make it simple to import all search indexers.

@ngosang
Copy link
Member

ngosang commented Apr 17, 2022

But what if you have too many?

In Radarr, Sonarr and related software you have to add one by one too. Please, do not delay this PR. When it's merged you can suggest more enhancements in other issues.

@glassez glassez modified the milestones: 4.5.0, 5.0 Jun 4, 2022
@glassez glassez force-pushed the torznab branch 2 times, most recently from d095b86 to e38dc68 Compare June 17, 2022 07:23
New Search subsystem uses external Torznab indexers.
@nbusseneau
Copy link

nbusseneau commented Oct 14, 2022

Hey friends, unofficial plugin author here, getting up to speed on this. I was aware of #121 but had not checked in in a long time, I see not only a decision has officially been made for replacement, but also that a lot of things have been done. Great work 👍🏻

I see nothing moved here in the last months, is there background work ongoing? Is this still shipping in 4.5.0 as stated above? I don't see it in the 4.5.0 milestone. Trying to gauge how I should prepare my plugin's users for this.

@glassez
Copy link
Member Author

glassez commented Oct 15, 2022

@nbusseneau
This work has been temporarily suspended.
I'm still not completely sure that Search Feature should become Torznab only. At the very least, I would like to make sure that it supports (at least at the configuration file level) the use of local executables as search engines.
It is also still unclear what to do with the related Web UI. I can't do it myself, and I haven't seen anyone else who would like to do this part of the work yet.

I don't see it in the 4.5.0 milestone.

It is in 5.0 milestone (but this is just a convention).

@Anutrix
Copy link

Anutrix commented Feb 1, 2024

I wonder if this will make it to 5.0

@glassez glassez removed this from the 5.0 milestone Feb 1, 2024
Copy link

github-actions bot commented Apr 2, 2024

This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity.

@github-actions github-actions bot added the Stale label Apr 2, 2024
@Anutrix
Copy link

Anutrix commented Apr 2, 2024

Any updates?

@github-actions github-actions bot removed the Stale label Apr 3, 2024
Copy link

github-actions bot commented Jun 2, 2024

This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity.

@github-actions github-actions bot added the Stale label Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Search engine Issues related to the search engine/search plugins functionality Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet