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:
edde746
2026-07-06 15:32:26 +02:00
co-authored by Claude Fable 5
parent 226be37f85
commit 5f7925f350
+5 -1
View File
@@ -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;