diff --git a/app/src/main/kotlin/org/akanework/gramophone/logic/GramophonePlaybackService.kt b/app/src/main/kotlin/org/akanework/gramophone/logic/GramophonePlaybackService.kt index 942c3ad7e..2af0a9532 100644 --- a/app/src/main/kotlin/org/akanework/gramophone/logic/GramophonePlaybackService.kt +++ b/app/src/main/kotlin/org/akanework/gramophone/logic/GramophonePlaybackService.kt @@ -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, diff --git a/app/src/main/kotlin/org/akanework/gramophone/logic/utils/SemanticLyrics.kt b/app/src/main/kotlin/org/akanework/gramophone/logic/utils/SemanticLyrics.kt index de29fb752..357ca9c4c 100644 --- a/app/src/main/kotlin/org/akanework/gramophone/logic/utils/SemanticLyrics.kt +++ b/app/src/main/kotlin/org/akanework/gramophone/logic/utils/SemanticLyrics.kt @@ -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