mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Fixes unable to dismiss next up during credits (#899)
## Description Fixes an issue where the "Next Up" popup continuously pops up when dismissed if you have "Show next up during credits/outro" enabled. ### Related issues Fixes #895 Bug introduced by #884 ### Testing Emulator ## Screenshots N/A ## AI or LLM usage None
This commit is contained in:
parent
1e810c1157
commit
44eb50910d
1 changed files with 6 additions and 2 deletions
|
|
@ -165,7 +165,6 @@ class PlaybackViewModel
|
|||
val currentPlayback = MutableStateFlow<CurrentPlayback?>(null)
|
||||
val currentItemPlayback = MutableLiveData<ItemPlayback>()
|
||||
val currentSegment = MutableStateFlow<MediaSegmentState?>(null)
|
||||
private val autoSkippedSegments = mutableSetOf<UUID>()
|
||||
|
||||
val subtitleCues = MutableLiveData<List<Cue>>(listOf())
|
||||
|
||||
|
|
@ -957,7 +956,10 @@ class PlaybackViewModel
|
|||
}
|
||||
}
|
||||
|
||||
// Variables for tracking segment state
|
||||
private var segmentJob: Job? = null
|
||||
private val autoSkippedSegments = mutableSetOf<UUID>()
|
||||
private val outroShownSegments = mutableSetOf<UUID>()
|
||||
|
||||
/**
|
||||
* Cancels listening for segments and clears current segment state
|
||||
|
|
@ -965,6 +967,7 @@ class PlaybackViewModel
|
|||
private fun resetSegmentState() {
|
||||
segmentJob?.cancel()
|
||||
autoSkippedSegments.clear()
|
||||
outroShownSegments.clear()
|
||||
currentSegment.value = null
|
||||
}
|
||||
|
||||
|
|
@ -1007,7 +1010,8 @@ class PlaybackViewModel
|
|||
|
||||
if (currentSegment.type == MediaSegmentType.OUTRO &&
|
||||
prefs.showNextUpWhen == ShowNextUpWhen.DURING_CREDITS &&
|
||||
playlist != null && playlist.hasNext()
|
||||
playlist != null && playlist.hasNext() &&
|
||||
outroShownSegments.add(currentSegment.id)
|
||||
) {
|
||||
val nextItem = playlist.peek()
|
||||
Timber.v("Setting next up during outro to ${nextItem?.id}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue