fix(library): show play actions during batch downloads

This commit is contained in:
zarzet
2026-08-27 13:56:48 +07:00
parent 47deb9f34e
commit 4609e59806
7 changed files with 115 additions and 35 deletions
+5 -7
View File
@@ -552,13 +552,11 @@ class _AlbumScreenState extends ConsumerState<AlbumScreen>
final historyLookups = tracks
.map(historyLookupForTrack)
.toList(growable: false);
final existingHistoryKeys = ref
.watch(
downloadHistoryBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
)
.maybeWhen(data: (keys) => keys, orElse: () => const <String>{});
final existingHistoryKeys = ref.watch(
downloadHistoryVisibleBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
);
return SliverPadding(
padding: EdgeInsets.symmetric(horizontal: wideListInset(context)),
sliver: SliverList(
+5 -7
View File
@@ -311,13 +311,11 @@ extension _ArtistScreenSections on _ArtistScreenState {
final historyLookups = tracks
.map(historyLookupForTrack)
.toList(growable: false);
final existingHistoryKeys = ref
.watch(
downloadHistoryBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
)
.maybeWhen(data: (keys) => keys, orElse: () => const <String>{});
final existingHistoryKeys = ref.watch(
downloadHistoryVisibleBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
);
const tracksPerPage = 5;
final pageCount = (tracks.length / tracksPerPage).ceil();
+5 -7
View File
@@ -406,13 +406,11 @@ extension _HomeTabSearchResultsUI on _HomeTabState {
final historyLookups = sortedTracks
.map(historyLookupForTrack)
.toList(growable: false);
final existingHistoryKeys = ref
.watch(
downloadHistoryBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
)
.maybeWhen(data: (keys) => keys, orElse: () => const <String>{});
final existingHistoryKeys = ref.watch(
downloadHistoryVisibleBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
);
slivers.addAll(
_buildVirtualizedResultSection(
title: context.l10n.searchSongs,
@@ -302,13 +302,11 @@ class _LibraryTracksFolderScreenState
final historyLookups = folderTracks
.map(historyLookupForTrack)
.toList(growable: false);
final existingHistoryKeys = ref
.watch(
downloadHistoryBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
)
.maybeWhen(data: (keys) => keys, orElse: () => const <String>{});
final existingHistoryKeys = ref.watch(
downloadHistoryVisibleBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
);
final bottomPadding = MediaQuery.paddingOf(context).bottom;
final bottomInset = context.navBarBottomInset;
+5 -7
View File
@@ -399,13 +399,11 @@ class _PlaylistScreenState extends ConsumerState<PlaylistScreen>
final historyLookups = _tracks
.map(historyLookupForTrack)
.toList(growable: false);
final existingHistoryKeys = ref
.watch(
downloadHistoryBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
)
.maybeWhen(data: (keys) => keys, orElse: () => const <String>{});
final existingHistoryKeys = ref.watch(
downloadHistoryVisibleBatchExistsProvider(
HistoryBatchLookupRequest(historyLookups),
),
);
return SliverPadding(
padding: EdgeInsets.symmetric(horizontal: wideListInset(context)),
sliver: SliverList(