Skip to content

Commit

Permalink
fix(playlist_queue): load method not preserving the active track befo…
Browse files Browse the repository at this point in the history
…re filtering blacklisted tracks
  • Loading branch information
KRTirtho committed Mar 7, 2023
1 parent 6bc1d32 commit 42b3e11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/provider/playlist_queue_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,14 @@ class PlaylistQueueNotifier extends PersistedStateNotifier<PlaylistQueue?> {
}

void load(Iterable<Track> tracks, {int active = 0}) {
final activeTrack = tracks.elementAt(active);
final filtered = Set.from(blacklist.filter(tracks));
state = PlaylistQueue(
Set.from(blacklist.filter(tracks)),
tempTracks: {},
active: active,
active: filtered
.toList()
.indexWhere((element) => element.id == activeTrack.id),
);
}

Expand Down

0 comments on commit 42b3e11

Please sign in to comment.