Skip to content

Commit

Permalink
Merge branch 'jonmarkhall-fix-cat-insertremove' into minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanheise committed Dec 15, 2024
2 parents f116d4a + f75582c commit fb7be45
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions just_audio_background/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.1-beta.14

* Fix shuffleOrder when mutating ConcatenatingAudioSource (@jonmarkhall).

## 0.0.1-beta.13

* Support rxdart 0.28.x.
Expand Down
6 changes: 6 additions & 0 deletions just_audio_background/lib/just_audio_background.dart
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,8 @@ class _PlayerAudioHandler extends BaseAudioHandler
ConcatenatingInsertAllRequest request) async {
final cat = _source!.findCat(request.id)!;
cat.children.insertAll(request.index, request.children);
cat.shuffleOrder
.replaceRange(0, cat.shuffleOrder.length, request.shuffleOrder);
_updateShuffleIndices();
_broadcastStateIfActive();
_updateQueue();
Expand All @@ -533,6 +535,8 @@ class _PlayerAudioHandler extends BaseAudioHandler
ConcatenatingRemoveRangeRequest request) async {
final cat = _source!.findCat(request.id)!;
cat.children.removeRange(request.startIndex, request.endIndex);
cat.shuffleOrder
.replaceRange(0, cat.shuffleOrder.length, request.shuffleOrder);
_updateShuffleIndices();
_broadcastStateIfActive();
_updateQueue();
Expand All @@ -544,6 +548,8 @@ class _PlayerAudioHandler extends BaseAudioHandler
final cat = _source!.findCat(request.id)!;
cat.children
.insert(request.newIndex, cat.children.removeAt(request.currentIndex));
cat.shuffleOrder
.replaceRange(0, cat.shuffleOrder.length, request.shuffleOrder);
_updateShuffleIndices();
_broadcastStateIfActive();
_updateQueue();
Expand Down
2 changes: 1 addition & 1 deletion just_audio_background/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: just_audio_background
description: An add-on for just_audio that supports background playback and media notifications.
homepage: https://github.com/ryanheise/just_audio/tree/master/just_audio_background
version: 0.0.1-beta.13
version: 0.0.1-beta.14
topics:
- audio
- sound
Expand Down

0 comments on commit fb7be45

Please sign in to comment.