From b3d630f2729b404d83131c0ed68611b44797b6d4 Mon Sep 17 00:00:00 2001 From: Ray <154766448+damontecres@users.noreply.github.com> Date: Thu, 16 Apr 2026 17:28:02 -0400 Subject: [PATCH] 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 --- .../damontecres/wholphin/preferences/AppPreference.kt | 4 ++-- .../damontecres/wholphin/ui/playback/PlaybackViewModel.kt | 8 +++++--- app/src/main/proto/WholphinDataStore.proto | 1 + app/src/main/res/values/strings.xml | 2 ++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/github/damontecres/wholphin/preferences/AppPreference.kt b/app/src/main/java/com/github/damontecres/wholphin/preferences/AppPreference.kt index 149b0098..4463dd97 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/preferences/AppPreference.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/preferences/AppPreference.kt @@ -826,8 +826,8 @@ sealed interface AppPreference { }, 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 = diff --git a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt index b9e51bb9..f6bc9018 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/ui/playback/PlaybackViewModel.kt @@ -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) { diff --git a/app/src/main/proto/WholphinDataStore.proto b/app/src/main/proto/WholphinDataStore.proto index a817fbae..60dd3943 100644 --- a/app/src/main/proto/WholphinDataStore.proto +++ b/app/src/main/proto/WholphinDataStore.proto @@ -6,6 +6,7 @@ option java_multiple_files = true; enum ShowNextUpWhen{ END_OF_PLAYBACK = 0; DURING_CREDITS = 1; + NEXT_UP_NEVER = 2; } enum SkipSegmentBehavior{ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5628f293..d00eed2d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -615,9 +615,11 @@ At the end of playback During end credits/outro + Never @string/next_up_playback_end @string/next_up_outro + @string/next_up_never White