mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-17 16:37:17 +02:00
fix(queue): resolve local album tracks by album_key
Load queue local album tracks from album_key when available and fall back to album/artist matching with empty album_artist handling. Thread album_key through grouped local album rows for more reliable navigation.
This commit is contained in:
@@ -967,7 +967,7 @@ class LibraryDatabase {
|
||||
final rows = await db.query(
|
||||
'library',
|
||||
where:
|
||||
'LOWER(album_name) = ? AND LOWER(COALESCE(album_artist, artist_name)) = ?',
|
||||
"LOWER(album_name) = ? AND LOWER(COALESCE(NULLIF(album_artist, ''), artist_name)) = ?",
|
||||
whereArgs: [albumName.toLowerCase(), artistName.toLowerCase()],
|
||||
orderBy:
|
||||
'COALESCE(disc_number, 0), COALESCE(track_number, 0), track_name',
|
||||
@@ -975,6 +975,20 @@ class LibraryDatabase {
|
||||
return rows.map(_dbRowToJson).toList(growable: false);
|
||||
}
|
||||
|
||||
Future<List<Map<String, dynamic>>> getQueueLocalAlbumTracksByKey(
|
||||
String albumKey,
|
||||
) async {
|
||||
final db = await database;
|
||||
final rows = await db.query(
|
||||
'library',
|
||||
where: 'album_key = ?',
|
||||
whereArgs: [albumKey],
|
||||
orderBy:
|
||||
'COALESCE(disc_number, 0), COALESCE(track_number, 0), track_name',
|
||||
);
|
||||
return rows.map(_dbRowToJson).toList(growable: false);
|
||||
}
|
||||
|
||||
String _queueTrackUnionSql(QueueLibraryDbQuery request, List<Object?> args) {
|
||||
final parts = <String>[];
|
||||
if (request.source != 'local') {
|
||||
|
||||
Reference in New Issue
Block a user