fix(music): scope current-track highlight per server
TrackRow compared bare ids (server-scoped rating keys), so a track on another server with the same id lit up as currently playing. Compare globalKey (serverId:id) like the rest of the queue engine. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
226be37f85
commit
5f7925f350
@@ -195,7 +195,11 @@ class _TrackRowState extends State<TrackRow> with ContextMenuTapMixin<TrackRow>,
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
// Both selects run unconditionally every build (provider contract).
|
||||
final isCurrentById = context.select<MusicPlaybackService, bool>((s) => s.currentTrack?.id == widget.item.id);
|
||||
// globalKey, not id: a bare ratingKey is server-scoped, so a track on
|
||||
// another server with the same id would falsely light up as current.
|
||||
final isCurrentById = context.select<MusicPlaybackService, bool>(
|
||||
(s) => s.currentTrack?.globalKey == widget.item.globalKey,
|
||||
);
|
||||
final serviceIsPlaying = context.select<MusicPlaybackService, bool>((s) => s.isPlaying);
|
||||
final isCurrent = widget.isCurrent ?? isCurrentById;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user