-
Notifications
You must be signed in to change notification settings - Fork 686
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
Backend.lookup should take a list of URIs #2116
Labels
A-core
Area: Core layer
C-enhancement
Category: A PR with an enhancement or an issue with an enhancement proposal
Milestone
Comments
Hi @kingosticks @jodal would I be able to be assigned to this? I think I am close to a PR for this. |
rchatrath7
pushed a commit
to rchatrath7/mopidy
that referenced
this issue
Jan 1, 2024
Resolves mopidy#2116. Changes `uri` param from `Uri` in `Backend.lookup` to `list[Uri]`. Also enforces the return type on `Backend.lookup` to be `Dict`. Changes `CoreLibrary.lookup` to pass in list of URIs into `Backend.lookup` instead of calling it individually.
rchatrath7
pushed a commit
to rchatrath7/mopidy
that referenced
this issue
Jan 1, 2024
Resolves mopidy#2116. Changes `uri` param from `Uri` in `Backend.lookup` to `list[Uri]`. Also enforces the return type on `Backend.lookup` to be `dict`. Changes `core.Library.lookup` to pass in list of URIs into `Backend.lookup` instead of calling it individually.
rchatrath7
pushed a commit
to rchatrath7/mopidy
that referenced
this issue
Jan 1, 2024
Resolves mopidy#2116. Changes `uri` param from `Uri` in `Backend.lookup` to `list[Uri]`. Also enforces the return type on `Backend.lookup` to be `dict`. Changes `core.Library.lookup` to pass in list of URIs into `Backend.lookup` instead of calling it individually.
rchatrath7
pushed a commit
to rchatrath7/mopidy
that referenced
this issue
Jan 1, 2024
Resolves mopidy#2116. Changes `uri` param from `Uri` in `Backend.lookup` to `list[Uri]`. Also enforces the return type on `Backend.lookup` to be `dict`. Changes `core.Library.lookup` to pass in list of URIs into `Backend.lookup` instead of calling it individually. Update test to batch uris for multiple backends
rchatrath7
pushed a commit
to rchatrath7/mopidy
that referenced
this issue
Mar 2, 2024
Resolves mopidy#2116. Changes `uri` param from `Uri` in `Backend.lookup` to `list[Uri]`. Also enforces the return type on `Backend.lookup` to be `dict`. Changes `core.Library.lookup` to pass in list of URIs into `Backend.lookup` instead of calling it individually. Update test to batch uris for multiple backends
rchatrath7
pushed a commit
to rchatrath7/mopidy
that referenced
this issue
Mar 5, 2024
…pt list of URIs Resolves mopidy#2116. Adds new method `Backend.lookup_many` as a replacement to `Backend.lookup` which accepts multiple URIs for lookup instead of a single URI. Provides a default implementation for `Backend.lookup_many` that iteratively calls `Backend.lookup` for backwards compatibility with existing backends. Update test to batch uris for multiple backends
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-core
Area: Core layer
C-enhancement
Category: A PR with an enhancement or an issue with an enhancement proposal
Currently
Backend.lookup()
is called byCore.LibraryController.lookup()
for each URI in turn. This prevents backends from potentially batching up the work. In some cases this wastes valuable API quota resources. We should makelookup()
work likeget_images()
which already supports lists.This will be a change to the
Backend
API so care will be needed to avoid breaking existing backends.The text was updated successfully, but these errors were encountered: