fix for newly introduced bug in queue
This commit is contained in:
parent
684ba6a2a4
commit
9ad3e4ec75
2 changed files with 16 additions and 1 deletions
|
@ -106,7 +106,7 @@ class DynamicQueue implements ManagedQueueInfo {
|
|||
_availableSongs,
|
||||
indices: [startIndex],
|
||||
keepIndex: keepIndex,
|
||||
blockLevel: calcBlockLevel(shuffleMode, _playableSubject.value),
|
||||
blockLevel: calcBlockLevel(shuffleMode, playable),
|
||||
);
|
||||
// if all songs would be filtered out, we just don't apply the filter
|
||||
if (filteredAvailableSongs.isEmpty) filteredAvailableSongs = _availableSongs;
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:mockito/annotations.dart';
|
|||
|
||||
import 'package:mucke/domain/entities/playable.dart';
|
||||
import 'package:mucke/domain/entities/queue_item.dart';
|
||||
import 'package:mucke/domain/entities/shuffle_mode.dart';
|
||||
import 'package:mucke/domain/modules/dynamic_queue.dart';
|
||||
import 'package:mucke/domain/repositories/music_data_repository.dart';
|
||||
import 'package:mucke/system/models/queue_item_model.dart';
|
||||
|
@ -403,4 +404,18 @@ void main() {
|
|||
expect(tFilteredAvailableSongs[newStartIndex], tAllAvailableSongs.first);
|
||||
});
|
||||
});
|
||||
|
||||
group('generateQueue: ShuffleMode.none', () {
|
||||
test('play album from start', () async {
|
||||
// arrange
|
||||
final tAlbumSongs = claymanSongs;
|
||||
|
||||
// act
|
||||
await sut.generateQueue(tAlbumSongs, clayman, 0, ShuffleMode.none);
|
||||
|
||||
// assert
|
||||
expect(sut.queue.length, tAlbumSongs.length);
|
||||
expect(sut.queue, tAlbumSongs);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue