mirror of
https://github.com/cranci1/Sora.git
synced 2026-03-23 02:49:23 +00:00
Merge pull request #2 from scigward/copilot/add-auto-skip-filler-setting
Add Auto Skip Filler Episodes setting
This commit is contained in:
commit
0add3fdd23
3 changed files with 24 additions and 1 deletions
|
|
@ -1373,7 +1373,21 @@ struct MediaInfoView: View {
|
|||
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
|
||||
fetchStream(href: nextEpisode.href)
|
||||
DropManager.shared.showDrop(
|
||||
|
|
|
|||
|
|
@ -302,6 +302,7 @@ struct SettingsViewBackup: View {
|
|||
"skipIntroOutroVisible",
|
||||
"pipButtonVisible",
|
||||
"autoplayNext",
|
||||
"autoSkipFillers",
|
||||
"videoQualityWiFi",
|
||||
"videoQualityCellular",
|
||||
"subtitlesEnabled",
|
||||
|
|
|
|||
|
|
@ -258,6 +258,7 @@ struct SettingsViewPlayer: View {
|
|||
@AppStorage("doubleTapSeekEnabled") private var doubleTapSeekEnabled: Bool = false
|
||||
@AppStorage("skipIntroOutroVisible") private var skipIntroOutroVisible: Bool = true
|
||||
@AppStorage("autoplayNext") private var autoplayNext: Bool = true
|
||||
@AppStorage("autoSkipFillers") private var autoSkipFillers: Bool = false
|
||||
@AppStorage("introDBEnabled") private var introDBEnabled: Bool = true
|
||||
|
||||
@AppStorage("videoQualityWiFi") private var wifiQuality: String = VideoQualityPreference.defaultWiFiPreference.rawValue
|
||||
|
|
@ -301,6 +302,13 @@ struct SettingsViewPlayer: View {
|
|||
showDivider: true
|
||||
)
|
||||
|
||||
SettingsToggleRow(
|
||||
icon: "forward.fill",
|
||||
title: NSLocalizedString("Auto Skip Filler Episodes", comment: ""),
|
||||
isOn: $autoSkipFillers,
|
||||
showDivider: true
|
||||
)
|
||||
|
||||
SettingsTextFieldRow(
|
||||
icon: "timer",
|
||||
title: NSLocalizedString("Completion Percentage", comment: ""),
|
||||
|
|
|
|||
Loading…
Reference in a new issue