Add option to never show next up episodes (#1257)

## Description
Adds an option to never show next up. This means when an episode
completes, the app always returns to the previous page instead of
suggesting the next episode.

### Related issues
Closes #1100

### Testing
Emulator

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Ray 2026-04-16 17:28:02 -04:00 committed by GitHub
parent b5422fe82b
commit b3d630f272
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 5 deletions

View file

@ -826,8 +826,8 @@ sealed interface AppPreference<Pref, T> {
},
displayValues = R.array.player_backend_options,
subtitles = R.array.player_backend_options_subtitles,
indexToValue = { PlayerBackend.forNumber(it) },
valueToIndex = { it.number },
indexToValue = { PlayerBackend.forNumber(it) ?: PlayerBackend.EXO_PLAYER },
valueToIndex = { if (it != PlayerBackend.UNRECOGNIZED) it.number else PlayerBackend.EXO_PLAYER.number },
)
val ExoPlayerSettings =

View file

@ -337,8 +337,10 @@ class PlaybackViewModel
navigationManager.goBack()
return
}
withContext(Dispatchers.Main) {
this@PlaybackViewModel.playlist.value = r.playlist
if (preferences.appPreferences.playbackPreferences.showNextUpWhen != ShowNextUpWhen.NEXT_UP_NEVER) {
withContext(Dispatchers.Main) {
this@PlaybackViewModel.playlist.value = r.playlist
}
}
r.playlist.items
.first()
@ -363,7 +365,7 @@ class PlaybackViewModel
playNextUp()
}
if (!isPlaylist) {
if (!isPlaylist && preferences.appPreferences.playbackPreferences.showNextUpWhen != ShowNextUpWhen.NEXT_UP_NEVER) {
val result = playlistCreator.createFrom(queriedItem)
if (result is PlaylistCreationResult.Success && result.playlist.items.isNotEmpty()) {
withContext(Dispatchers.Main) {