Skip to content

Encode search results as JSON #22971

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

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

Conversation

glassez
Copy link
Member

@glassez glassez commented Jul 8, 2025

Encoding results as JSON objects makes them more flexible.

@glassez glassez requested review from Chocobo1 and a team July 8, 2025 13:00
@glassez glassez added the Search engine Issues related to the search engine/search plugins functionality label Jul 8, 2025
@xavier2k6
Copy link
Member

quick test, don't get any published date for limetorrents/piratebay - haven't cross referenced against release/master.

@Chocobo1
Copy link
Member

Chocobo1 commented Jul 8, 2025

I don't have strong opinion on this change but you must know this: https://github.com/qbittorrent/search-plugins/wiki/How-to-write-a-search-plugin#search-results-format
The output format is actually specified and I'm not sure all 3rd party plugins uses prettyPrinter().
Also you should update the wiki content if you go forward with this PR.

@glassez
Copy link
Member Author

glassez commented Jul 9, 2025

The output format is actually specified and I'm not sure all 3rd party plugins uses prettyPrinter().
Also you should update the wiki content if you go forward with this PR.

It's not a problem to update the Wiki. It also wouldn't be a very big problem to support both formats at this stage.
But actually, I have some more ideas about the search engine implementation redesign that involve even more breaking changes. So if possible breaking changes are perceived negatively by the community, I'll just spit on it and not continue this topic. I will also have to give up on solving those search engine related issues, the solution of which within the existing design (i.e. without breaking changes) would look like a "dirty" workaround (which I really dislike).

@Chocobo1
Copy link
Member

It's not a problem to update the Wiki.

👍
The wiki is crucial for the plugin authors. We can't tell them how to update to the latest format without some documentation.

It also wouldn't be a very big problem to support both formats at this stage.

If possible, qbt can support both formats and log a warning message if the old format was used/detected. This would encourage plugin authors to update to the new format and ensure no breakage. The old format would be supported for one or two major releases and dropped afterwards.

But actually, I have some more ideas about the search engine implementation redesign that involve even more breaking changes.

I hope you would ensure the 'official' plugins will still be working (by updating them if needed).

So if possible breaking changes are perceived negatively by the community, I'll just spit on it and not continue this topic.

How are you going to know it beforehand? I suppose you will have to break it first and then receive feedback.

@glassez
Copy link
Member Author

glassez commented Jul 12, 2025

How are you going to know it beforehand?

Perhaps some of the community's active members will speak about this in advance.

The old format would be supported for one or two major releases and dropped afterwards.

This is not a problem if it is limited to this change. However, if we go further, maintaining backward compatibility may become too cumbersome.

@Chocobo1
Copy link
Member

Chocobo1 commented Jul 12, 2025

This is not a problem if it is limited to this change. However, if we go further, maintaining backward compatibility may become too cumbersome.

How about adding a version tag, for example QBT_SEARCH_ENGINE_FORMAT = n, n >= 0. The tag will be present in the plugin and qbt will choose different code path based on the tag value. If the tag is absent then n = 0 and future format updates will increment n. Will this help?

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants