mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
fix(playlist_queue): load method not preserving the active track before filtering blacklisted tracks
This commit is contained in:
parent
6bc1d32a88
commit
42b3e111f8
@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user