mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
Remove slow lookups from beetsplug/aura
It seems like previously filtering by flexible attributes did not work
- I'd receive '{"data": []}' trying to GET `/aura/tracks?filter[play_count]=11`
Now this works, not only for tracks, but for `/aura/artists` and
`/aura/albums` too.
Additionally, this improves `/aura/tracks` response time significantly.
I tried loading the default of 500 tracks from my library:
On `master`, it took ~20s
After this commit, it takes under 1s.
This commit is contained in:
parent
9207b17d13
commit
e0c50c5501
1 changed files with 3 additions and 2 deletions
|
|
@ -180,8 +180,9 @@ class AURADocument:
|
|||
converter = self.get_attribute_converter(beets_attr)
|
||||
value = converter(value)
|
||||
# Add exact match query to list
|
||||
# Use a slow query so it works with all fields
|
||||
queries.append(MatchQuery(beets_attr, value, fast=False))
|
||||
queries.append(
|
||||
self.model_cls.field_query(beets_attr, value, MatchQuery)
|
||||
)
|
||||
# NOTE: AURA doesn't officially support multiple queries
|
||||
return AndQuery(queries)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue