fix: add whole queue to song list

This commit is contained in:
Matyáš Caras 2024-05-28 19:03:59 +02:00
parent 773cf12b97
commit 2ef04267d7
Signed by: hernik
GPG key ID: 2A3175F98820C5C6

View file

@ -40,9 +40,8 @@ class AudioPlayerService {
/// Currently playing song /// Currently playing song
/// ///
/// Null if no song is loaded /// Null if no song is loaded
Song? get song => _player.currentIndex == null || _player.currentIndex == -1 Song? get song =>
? null _player.currentIndex == null ? null : _songList[_player.currentIndex!];
: _songList[_player.currentIndex!];
final _queue = ConcatenatingAudioSource( final _queue = ConcatenatingAudioSource(
children: [], children: [],
@ -126,6 +125,7 @@ class AudioPlayerService {
await _queue.clear(); await _queue.clear();
_songList _songList
..clear() ..clear()
..addAll(queuePast)
..addAll(queueNext); ..addAll(queueNext);
final q = List<AudioSource>.generate( final q = List<AudioSource>.generate(