mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
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:
parent
b5422fe82b
commit
b3d630f272
4 changed files with 10 additions and 5 deletions
|
|
@ -826,8 +826,8 @@ sealed interface AppPreference<Pref, T> {
|
||||||
},
|
},
|
||||||
displayValues = R.array.player_backend_options,
|
displayValues = R.array.player_backend_options,
|
||||||
subtitles = R.array.player_backend_options_subtitles,
|
subtitles = R.array.player_backend_options_subtitles,
|
||||||
indexToValue = { PlayerBackend.forNumber(it) },
|
indexToValue = { PlayerBackend.forNumber(it) ?: PlayerBackend.EXO_PLAYER },
|
||||||
valueToIndex = { it.number },
|
valueToIndex = { if (it != PlayerBackend.UNRECOGNIZED) it.number else PlayerBackend.EXO_PLAYER.number },
|
||||||
)
|
)
|
||||||
|
|
||||||
val ExoPlayerSettings =
|
val ExoPlayerSettings =
|
||||||
|
|
|
||||||
|
|
@ -337,8 +337,10 @@ class PlaybackViewModel
|
||||||
navigationManager.goBack()
|
navigationManager.goBack()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
withContext(Dispatchers.Main) {
|
if (preferences.appPreferences.playbackPreferences.showNextUpWhen != ShowNextUpWhen.NEXT_UP_NEVER) {
|
||||||
this@PlaybackViewModel.playlist.value = r.playlist
|
withContext(Dispatchers.Main) {
|
||||||
|
this@PlaybackViewModel.playlist.value = r.playlist
|
||||||
|
}
|
||||||
}
|
}
|
||||||
r.playlist.items
|
r.playlist.items
|
||||||
.first()
|
.first()
|
||||||
|
|
@ -363,7 +365,7 @@ class PlaybackViewModel
|
||||||
playNextUp()
|
playNextUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isPlaylist) {
|
if (!isPlaylist && preferences.appPreferences.playbackPreferences.showNextUpWhen != ShowNextUpWhen.NEXT_UP_NEVER) {
|
||||||
val result = playlistCreator.createFrom(queriedItem)
|
val result = playlistCreator.createFrom(queriedItem)
|
||||||
if (result is PlaylistCreationResult.Success && result.playlist.items.isNotEmpty()) {
|
if (result is PlaylistCreationResult.Success && result.playlist.items.isNotEmpty()) {
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ option java_multiple_files = true;
|
||||||
enum ShowNextUpWhen{
|
enum ShowNextUpWhen{
|
||||||
END_OF_PLAYBACK = 0;
|
END_OF_PLAYBACK = 0;
|
||||||
DURING_CREDITS = 1;
|
DURING_CREDITS = 1;
|
||||||
|
NEXT_UP_NEVER = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum SkipSegmentBehavior{
|
enum SkipSegmentBehavior{
|
||||||
|
|
|
||||||
|
|
@ -615,9 +615,11 @@
|
||||||
|
|
||||||
<string name="next_up_playback_end">At the end of playback</string>
|
<string name="next_up_playback_end">At the end of playback</string>
|
||||||
<string name="next_up_outro">During end credits/outro</string>
|
<string name="next_up_outro">During end credits/outro</string>
|
||||||
|
<string name="next_up_never">Never</string>
|
||||||
<string-array name="show_next_up_when_options">
|
<string-array name="show_next_up_when_options">
|
||||||
<item>@string/next_up_playback_end</item>
|
<item>@string/next_up_playback_end</item>
|
||||||
<item>@string/next_up_outro</item>
|
<item>@string/next_up_outro</item>
|
||||||
|
<item>@string/next_up_never</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string name="white">White</string>
|
<string name="white">White</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue