diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 64ee89d2..fed66850 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -53,7 +53,7 @@ body: description: Where did you install Spotube from? multiple: true options: - - "Website (spotube.netlify.app) or (spotube.krtirtho.dev)" + - "Website (spotube.krtirtho.dev)" - "GitHub Releases (Binary)" - "GitHub Actions (Nightly Binary)" - "Play Store (Android)" @@ -77,4 +77,4 @@ body: description: If you are a developer and want to work on this issue yourself, you can check this box and wait for maintainer response. We welcome contributions! options: - label: I'm ready to work on this issue! - required: false \ No newline at end of file + required: false diff --git a/lib/provider/audio_player/audio_player.dart b/lib/provider/audio_player/audio_player.dart index 9dfc2c0a..da22b2ce 100644 --- a/lib/provider/audio_player/audio_player.dart +++ b/lib/provider/audio_player/audio_player.dart @@ -89,6 +89,12 @@ class AudioPlayerNotifier extends Notifier { autoPlay: false, ); } + + if (playerState.collections.isNotEmpty) { + state = state.copyWith( + collections: playerState.collections, + ); + } } Future _updatePlayerState( diff --git a/lib/provider/history/recent.dart b/lib/provider/history/recent.dart index 4e445500..8894b713 100644 --- a/lib/provider/history/recent.dart +++ b/lib/provider/history/recent.dart @@ -9,28 +9,31 @@ class RecentlyPlayedItemNotifier extends AsyncNotifier> { build() async { final database = ref.watch(databaseProvider); - final uniqueItemIds = - await (database.selectOnly(database.historyTable, distinct: true) - ..addColumns([database.historyTable.itemId]) - ..where( - database.historyTable.type.isIn([ - HistoryEntryType.playlist.name, - HistoryEntryType.album.name, - ]), - ) - ..limit(10)) - .map((row) => row.read(database.historyTable.itemId)) - .get() - .then((value) => value.whereNotNull().toList()); + final uniqueItemIds = await (database.selectOnly(database.historyTable, + distinct: true) + ..addColumns([database.historyTable.itemId, database.historyTable.id]) + ..where( + database.historyTable.type.isIn([ + HistoryEntryType.playlist.name, + HistoryEntryType.album.name, + ]), + ) + ..limit(10) + ..orderBy([ + OrderingTerm( + expression: database.historyTable.createdAt, + mode: OrderingMode.desc, + ), + ])) + .map( + (row) => row.read(database.historyTable.id), + ) + .get() + .then((value) => value.whereNotNull().toList()); final query = database.select(database.historyTable) ..where( - (tbl) => - tbl.type.isIn([ - HistoryEntryType.playlist.name, - HistoryEntryType.album.name, - ]) & - tbl.itemId.isIn(uniqueItemIds), + (tbl) => tbl.id.isIn(uniqueItemIds), ) ..orderBy([ (tbl) => OrderingTerm( @@ -45,7 +48,9 @@ class RecentlyPlayedItemNotifier extends AsyncNotifier> { ref.onDispose(() => subscription.cancel()); - return await query.get(); + final items = await query.get(); + + return items; } }