feat(player): continue playback with Library autoplay

This commit is contained in:
zarzet committed 2026-09-27 11:53:40 +07:00
1 parent 9e4f24ba24
commit 5f0463a7a4
14 files changed
+643 -12

No files matched your search

+8
View File
@@ -92,6 +92,10 @@ class _MainShellState extends ConsumerState<MainShell>
ref.read(settingsProvider).playbackNormalization,
);
setAutoMixEnabled(ref.read(settingsProvider).autoMix);
setAutoplayEnabled(
ref.read(settingsProvider).autoplay,
includeLocal: ref.read(settingsProvider).localLibraryEnabled,
);
// Deezer & co. localize artist/genre names by IP unless told the app's
// language (issue #480).
unawaited(
@@ -738,6 +742,10 @@ class _MainShellState extends ConsumerState<MainShell>
ref.listen(settingsProvider.select((s) => s.autoMix), (_, enabled) {
setAutoMixEnabled(enabled);
});
ref.listen(
settingsProvider.select((s) => (s.autoplay, s.localLibraryEnabled)),
(_, value) => setAutoplayEnabled(value.$1, includeLocal: value.$2),
);
final queueState = ref.watch(
downloadQueueProvider.select((s) => s.queuedCount),
);
+14
View File
@@ -2356,6 +2356,9 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
),
);
final textTheme = Theme.of(context).textTheme;
final autoplay = ref.watch(
settingsProvider.select((s) => s.autoplay),
);
return Column(
children: [
@@ -2371,6 +2374,17 @@ class _NowPlayingScreenState extends ConsumerState<NowPlayingScreen> {
),
),
const Spacer(),
IconButton(
tooltip: autoplay
? context.l10n.autoplayOn
: context.l10n.autoplayOff,
isSelected: autoplay,
icon: const Icon(Icons.all_inclusive),
color: autoplay ? colorScheme.primary : null,
onPressed: () => ref
.read(settingsProvider.notifier)
.setAutoplay(!autoplay),
),
IconButton(
tooltip: switch (repeatMode) {
AudioServiceRepeatMode.one =>