feat: show optional SponsorBlock ranges on playback timeline

This commit is contained in:
2026-10-25 03:01:40 +01:00
parent edb17f76e3
commit b04ed7fdc8
9 changed files with 666 additions and 24 deletions
+23
View File
@@ -206,6 +206,28 @@ struct PlayerMiruroMenu: View {
}
}
@MainActor
struct PlayerSponsorBlockMenu: View {
@ObservedObject var model: PlayerModel
var body: some View {
Menu("SponsorBlock") {
Toggle("Show Sponsored Ranges", isOn: Binding(
get: { model.sponsorBlockEnabled },
set: { model.setSponsorBlockEnabled($0) }))
Text("Connects to sponsor.ajay.app using a video-ID hash prefix.")
Text("Reduces disclosure; not anonymous. Display only, never skips.")
Link("(Using SponsorBlock)", destination: URL(string: "https://sponsor.ajay.app/")!)
Menu("Acknowledgements") {
Text("Uses SponsorBlock data under CC BY-NC-SA 4.0")
Link("CC BY-NC-SA 4.0 License",
destination: URL(string: "https://creativecommons.org/licenses/by-nc-sa/4.0/")!)
Text("Display filters and merges ranges; does not modify source timings.")
}
}
}
}
@MainActor
struct PlayerCommands: Commands {
@FocusedObject private var focusedModel: PlayerModel?
@@ -311,6 +333,7 @@ struct PlayerCommands: Commands {
}
}
PlayerMiruroMenu(model: model).disabled(!hasFocusedScene)
PlayerSponsorBlockMenu(model: model)
Button(model.showsBufferInfo ? "Hide Buffer Info" : "Show Buffer Info") {
model.performMenuAction(bufferInfo)
}