-
Notifications
You must be signed in to change notification settings - Fork 690
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
Add ability to exclude backends during search #2001
base: main
Are you sure you want to change the base?
Conversation
My primary motivation for this functionality is to exclude search results from the Youtube extension when using an MPD client. I'll be submitting a follow-up patch to the MPD extension once this is merged. |
14a80ca
to
7a9e7ad
Compare
Just looking at the API it's a bit weird that there is an argument for including stuff called Also, out of interest, why would the MPD backend always want to exclude youtube results? |
I could make it take full URIs if you want, but it would just add unnecessary work to the process. The logic only requires URI schemes.
The idea is that it would be based on configuration. In my experience I don't generally want search results from Youtube most of the time, but the MPD interface doesn't provide for the ability to select which backends I want search results from. Therefore, it would need to be handled server-side with configuration. |
It's just a weird API to have both uris and schemes for these almost complementary options. It feels like they should both work the same and not be very subtly different:
I can just see myself trying to do
Wouldn't it be preferable to add a disable searching option to Mopidy-Youtube itself? This would work regardless of the frontend being used. |
Sure, I'll add support for full URIs.
I don't want to fully disable searching in the Youtube extension. The Mopidy frontends I use regularly (musicbox and iris) support choosing which backend(s) to retrieve search results from, and sometimes I do want search results from Youtube. However most of the time I only want results from non-youtube. On the other hand, the MPD protocol has no concept of mopidy backends, so there's no way for the end user to filter out Youtube search results there. |
39f0661
to
a6411ed
Compare
We could support some more MPD filters, this one, combined with the negation operator (!) should allow us to exclude backends:
But the user would have to do this all manually from their client. I think I would actually use this myself, I usually want to restrict searches to Spotify and being able to do that via MPD would be nice. |
For my setup at home, this will need to work from clients like MALP and be usable by non-technical people who have no idea what MPD is. Manually crafting search queries isn't an option for me. Regardless, this functionality would need to be supported in the Mopidy core. |
True, it is too technical for most. Going back to your use case, if your new config setting in MPD is set to exclude youtube then Mopidy-MPD can call |
I suppose so, but that feels like a lot more work than just passing a list of URI schemes directly from the configuration. |
This lets you exclude just a single search results provider, rather than having to manually select all providers you do want search results from. This will be useful in situations where it isn't possible for human users to select which backends they want results from, such as through the MPD frontend. I also took the chance to rename the function 'get_backends_to_uris' to 'get_backends_for_uris', because it's a more accurate representation of what it does.
a6411ed
to
ed39c37
Compare
This lets you exclude just a single search results provider, rather than
having to manually select all providers you do want search results from.
This will be useful in situations where it isn't possible for human
users to select which backends they want results from, such as through
the MPD frontend.
I also took the chance to rename the function 'get_backends_to_uris' to
'get_backends_for_uris', because it's a more accurate representation of
what it does.