Skip to content

Commit

Permalink
fix: album sync not working
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 1, 2023
1 parent 8d30fff commit 74906f3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/provider/proxy_playlist/proxy_playlist_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,7 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist>

Future<void> updatePalette() {
return Future.microtask(() async {
final activeTrack = state.tracks.firstWhereOrNull(
(track) =>
track is SpotubeTrack && track.ytUri == audioPlayer.currentSource,
);
final activeTrack = state.tracks.elementAtOrNull(state.active ?? 0);

if (activeTrack == null) return;

Expand All @@ -385,6 +382,8 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist>
super.state = state;
if (state.tracks.isEmpty && ref.read(paletteProvider) != null) {
ref.read(paletteProvider.notifier).state = null;
} else {
updatePalette();
}
}

Expand Down

0 comments on commit 74906f3

Please sign in to comment.