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

How to dispatch.browse(lookup=False) ? #25

Open
stacyharper opened this issue Feb 5, 2020 · 5 comments
Open

How to dispatch.browse(lookup=False) ? #25

stacyharper opened this issue Feb 5, 2020 · 5 comments

Comments

@stacyharper
Copy link

Context:
I work on a subsonic backend and I'm browsing artist/albums/tracks.
When returning a list of Ref.track, mopidy-mpd want to lookup those uri one by one.

I'd like to not lookup browsed Ref.tracks.
It is possible to add a config to toggle automatic lookup on browsing ?

@kingosticks
Copy link
Member

Such a config option would effect all backends. The MPD client will expect full track metadata from lsinfo so it's not ideal to work around a particular backend's issue like this. Instead, would grouping the lookups rather than doing them one by one help?

@stacyharper
Copy link
Author

stacyharper commented Feb 6, 2020 via email

@kingosticks
Copy link
Member

kingosticks commented Feb 6, 2020

library.lookup take uri and not uris for a good reason.

Currently Backend.LibraryProvider.lookup doesn't take a list of uris but I don't think there is a good reason for that shortcoming, it's just historical. We should address this in Mopidy 3 (@jodal) as many APIs do provide a feature for batched requests (IMO essential when talking to a remote data source).

My backend returns refs cause this just is enough to
display my track names in a browse context.

No, your backend's browse implementation must returns Refs because that's what the Mopidy API specifies.

lsinfo uses recursive=False. The other ls* MPD commands use recursive browsing but they are disabled by default. add uses the recursive mode but that makes sense to me. And that's also where the browse without lookup mode originates from (which, yes, we could look at also using for lsinfo but I'm still not enthusiastic about a config that disables the extra metadata for those backends that can lookup properly). Exactly what MPD command are you referring to?

@stacyharper
Copy link
Author

stacyharper commented Feb 6, 2020 via email

@stacyharper
Copy link
Author

stacyharper commented Feb 6, 2020 via email

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

No branches or pull requests

2 participants