Skip to content

Commit

Permalink
fix potential crash
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Nov 30, 2024
1 parent 4e80a87 commit 3c8d16f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ class GramophonePlaybackService : MediaLibraryService(), MediaSessionService.Lis
if (events.contains(EVENT_SHUFFLE_MODE_ENABLED_CHANGED)
&& !events.contains(Player.EVENT_TIMELINE_CHANGED)) {
// when enabling shuffle, re-shuffle lists so that the first index is up to date
Log.i(TAG, "re-shuffling playlist")
endedWorkaroundPlayer?.setShuffleOrder {
CircularShuffleOrder(
it,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ private sealed class SyntacticLrc {
// If you want to write [bg: into your lyrics, you'll probably have to add the
// conditional surrounding this comment into the
// if (out.isEmpty() || out.last() is NewLine) below.
if (!out.isEmpty() && out.last() !is NewLine)
if (out.isNotEmpty() && out.last() !is NewLine)
out.add(NewLine.SyntheticNewLine())
val lastWasV2 = out.subList(0, out.size - 1).indexOfLast { it is NewLine }
.let { if (it < 0) null else it }?.let {
val lastWasV2 = out.isNotEmpty() && out.subList(0, out.size - 1)
.indexOfLast { it is NewLine }.let { if (it < 0) null else it }?.let {
(out.subList(it, out.size - 1).findLast { it is SpeakerTag }
as SpeakerTag?)?.speaker?.isVoice2
} == true
Expand Down

0 comments on commit 3c8d16f

Please sign in to comment.