Show "play next" option when song is already in queue

This commit is contained in:
G1org1o 2025-02-17 22:01:30 +01:00 committed by GitHub
parent 8c1337d1fc
commit 96d35f429c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -344,24 +344,24 @@ class TrackOptions extends HookConsumerWidget {
title: Text(context.l10n.go_to_album), title: Text(context.l10n.go_to_album),
subtitle: Text(track.album!.name!), subtitle: Text(track.album!.name!),
), ),
if (!playlist.containsTrack(track)) ...[ if (!playlist.containsTrack(track))
PopSheetEntry( PopSheetEntry(
value: TrackOptionValue.addToQueue, value: TrackOptionValue.addToQueue,
leading: const Icon(SpotubeIcons.queueAdd), leading: const Icon(SpotubeIcons.queueAdd),
title: Text(context.l10n.add_to_queue), title: Text(context.l10n.add_to_queue),
), ),
PopSheetEntry( else
value: TrackOptionValue.playNext,
leading: const Icon(SpotubeIcons.lightning),
title: Text(context.l10n.play_next),
),
] else
PopSheetEntry( PopSheetEntry(
value: TrackOptionValue.removeFromQueue, value: TrackOptionValue.removeFromQueue,
enabled: playlist.activeTrack?.id != track.id, enabled: playlist.activeTrack?.id != track.id,
leading: const Icon(SpotubeIcons.queueRemove), leading: const Icon(SpotubeIcons.queueRemove),
title: Text(context.l10n.remove_from_queue), title: Text(context.l10n.remove_from_queue),
), ),
PopSheetEntry(
value: TrackOptionValue.playNext,
leading: const Icon(SpotubeIcons.lightning),
title: Text(context.l10n.play_next),
),
if (me.asData?.value != null && !isLocalTrack) if (me.asData?.value != null && !isLocalTrack)
PopSheetEntry( PopSheetEntry(
value: TrackOptionValue.favorite, value: TrackOptionValue.favorite,