mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-19 22:17:29 +02:00
fix(library): honor album artist filters in summary counts
This commit is contained in:
1 parent
a8712a44b1
commit
bf40ef8ebe
2 files changed
+18
No files matched your search
@@ -148,6 +148,7 @@ class LibraryQueueStore {
|
||||
QueueLibraryDbQuery request,
|
||||
) async {
|
||||
if (sqlite.normalizeLookupText(request.searchQuery).isNotEmpty ||
|
||||
request.albumArtist != null ||
|
||||
request.quality != null ||
|
||||
request.format != null ||
|
||||
request.metadata != null) {
|
||||
|
||||
@@ -231,6 +231,23 @@ void main() {
|
||||
},
|
||||
);
|
||||
|
||||
test('artist counts use the same filter as the track query', () async {
|
||||
for (final artist in ['Artist', 'Another Artist', 'Missing Artist']) {
|
||||
final query = QueueLibraryDbQuery(albumArtist: artist);
|
||||
final counts = await store.counts(query);
|
||||
final tracks = await store.trackPage(query);
|
||||
expect(counts.allTrackCount, tracks.rows.length, reason: artist);
|
||||
expect(
|
||||
[counts.allTrackCount, counts.albumCount, counts.singleTrackCount],
|
||||
switch (artist) {
|
||||
'Artist' => [4, 2, 0],
|
||||
'Another Artist' => [1, 0, 1],
|
||||
_ => [0, 0, 0],
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test(
|
||||
'independent FTS inputs match LIKE fallback and escape literal search',
|
||||
() async {
|
||||
|
||||
Reference in new issue
Block a user