mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-21 00:22:12 +00:00
Add Auto Skip Filler Episodes setting in player settings
Co-authored-by: scigward <162128369+scigward@users.noreply.github.com>
This commit is contained in:
parent
5a76bf97cd
commit
2f6614b2fb
3 changed files with 24 additions and 1 deletions
|
|
@ -1373,7 +1373,21 @@ struct MediaInfoView: View {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let nextEpisode = episodeLinks[currentIndex + 1]
|
let autoSkipFillers = UserDefaults.standard.bool(forKey: "autoSkipFillers")
|
||||||
|
var nextIndex = currentIndex + 1
|
||||||
|
|
||||||
|
if autoSkipFillers, let fillerSet = jikanFillerSet {
|
||||||
|
while nextIndex < episodeLinks.count, fillerSet.contains(episodeLinks[nextIndex].number) {
|
||||||
|
Logger.shared.log("Skipping filler episode \(episodeLinks[nextIndex].number)", type: "Debug")
|
||||||
|
nextIndex += 1
|
||||||
|
}
|
||||||
|
guard nextIndex < episodeLinks.count else {
|
||||||
|
Logger.shared.log("No more non-filler episodes to play", type: "Info")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let nextEpisode = episodeLinks[nextIndex]
|
||||||
selectedEpisodeNumber = nextEpisode.number
|
selectedEpisodeNumber = nextEpisode.number
|
||||||
fetchStream(href: nextEpisode.href)
|
fetchStream(href: nextEpisode.href)
|
||||||
DropManager.shared.showDrop(
|
DropManager.shared.showDrop(
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,7 @@ struct SettingsViewBackup: View {
|
||||||
"skipIntroOutroVisible",
|
"skipIntroOutroVisible",
|
||||||
"pipButtonVisible",
|
"pipButtonVisible",
|
||||||
"autoplayNext",
|
"autoplayNext",
|
||||||
|
"autoSkipFillers",
|
||||||
"videoQualityWiFi",
|
"videoQualityWiFi",
|
||||||
"videoQualityCellular",
|
"videoQualityCellular",
|
||||||
"subtitlesEnabled",
|
"subtitlesEnabled",
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,7 @@ struct SettingsViewPlayer: View {
|
||||||
@AppStorage("doubleTapSeekEnabled") private var doubleTapSeekEnabled: Bool = false
|
@AppStorage("doubleTapSeekEnabled") private var doubleTapSeekEnabled: Bool = false
|
||||||
@AppStorage("skipIntroOutroVisible") private var skipIntroOutroVisible: Bool = true
|
@AppStorage("skipIntroOutroVisible") private var skipIntroOutroVisible: Bool = true
|
||||||
@AppStorage("autoplayNext") private var autoplayNext: Bool = true
|
@AppStorage("autoplayNext") private var autoplayNext: Bool = true
|
||||||
|
@AppStorage("autoSkipFillers") private var autoSkipFillers: Bool = false
|
||||||
@AppStorage("introDBEnabled") private var introDBEnabled: Bool = true
|
@AppStorage("introDBEnabled") private var introDBEnabled: Bool = true
|
||||||
|
|
||||||
@AppStorage("videoQualityWiFi") private var wifiQuality: String = VideoQualityPreference.defaultWiFiPreference.rawValue
|
@AppStorage("videoQualityWiFi") private var wifiQuality: String = VideoQualityPreference.defaultWiFiPreference.rawValue
|
||||||
|
|
@ -301,6 +302,13 @@ struct SettingsViewPlayer: View {
|
||||||
showDivider: true
|
showDivider: true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SettingsToggleRow(
|
||||||
|
icon: "forward.fill",
|
||||||
|
title: NSLocalizedString("Auto Skip Filler Episodes", comment: ""),
|
||||||
|
isOn: $autoSkipFillers,
|
||||||
|
showDivider: true
|
||||||
|
)
|
||||||
|
|
||||||
SettingsTextFieldRow(
|
SettingsTextFieldRow(
|
||||||
icon: "timer",
|
icon: "timer",
|
||||||
title: NSLocalizedString("Completion Percentage", comment: ""),
|
title: NSLocalizedString("Completion Percentage", comment: ""),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue