[skip-ci] SponsorBlock "Hook/Greetings" category

This commit is contained in:
Brahim Hadriche committed 2026-06-17 21:09:35 -04:00
1 parent 7a976bbe3d
commit 62dcc14042
16 files changed
+62 -32

No files matched your search

+1
View File
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Playlet already supported 4K videos. This adds a support check, and quality selectors in the settings, for the devices that support it. - Playlet already supported 4K videos. This adds a support check, and quality selectors in the settings, for the devices that support it.
- Not all 4k supporting devices - only with AV1 support (usually newer devices) - Not all 4k supporting devices - only with AV1 support (usually newer devices)
- Not all 4k videos are playable, only AV1 encoded videos - Not all 4k videos are playable, only AV1 encoded videos
- SponsorBlock "Hook/Greetings" category
### Fixed ### Fixed
@@ -32,7 +32,7 @@
numColumns="1" numColumns="1"
numRows="10" numRows="10"
vertFocusAnimationStyle="floatingFocus" vertFocusAnimationStyle="floatingFocus"
translation="[40,100]" translation="[40,90]"
focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" /> focusBitmapUri="pkg:/images/focus-glow-padding-19.9.png" />
<ButtonEx <ButtonEx
@@ -40,13 +40,13 @@
iconVisible="false" iconVisible="false"
text="Save" text="Save"
padding="[30,30]" padding="[30,30]"
translation="[340,500]" /> translation="[340,520]" />
<ButtonEx <ButtonEx
id="closeButton" id="closeButton"
iconVisible="false" iconVisible="false"
text="Close" text="Close"
padding="[30,30]" padding="[30,30]"
translation="[496,500]" /> translation="[496,520]" />
</Rectangle> </Rectangle>
</children> </children>
</component> </component>
@@ -178,6 +178,16 @@ function MigrateExistingPreferences(userPrefs as object) as boolean
isDirty = true isDirty = true
end if end if
if userPrefs.__version = 6
' Hook was split out of Preview. Existing users inherit their Preview setting.
categories = userPrefs["sponsorblock.categories"]
if IsAssociativeArray(categories) and not categories.DoesExist("hook") and IsAssociativeArray(categories["preview"])
categories["hook"] = { option: categories["preview"].option }
end if
userPrefs.__version = 7
isDirty = true
end if
' TODO:P2 handle case where saved preferences version is higher than current version (e.g. user downgraded) ' TODO:P2 handle case where saved preferences version is higher than current version (e.g. user downgraded)
#if DEBUG #if DEBUG
@@ -5,7 +5,7 @@
user prefs saved need to be migrated. If the version is less than the user prefs saved need to be migrated. If the version is less than the
current version, a migration is needed. current version, a migration is needed.
--> -->
<field id="__version" type="integer" value="6" /> <field id="__version" type="integer" value="7" />
<field id="prefsModel" type="array" /> <field id="prefsModel" type="array" />
<field id="preferenceFields" type="assocarray" /> <field id="preferenceFields" type="assocarray" />
<function name="GetUserPreferences" /> <function name="GetUserPreferences" />
@@ -92,7 +92,7 @@ end function
function GetOptionForSegment(segment as object, categories as object) as string function GetOptionForSegment(segment as object, categories as object) as string
category = categories[segment.category] category = categories[segment.category]
if not IsAssociativeArray(category) if not IsAssociativeArray(category)
return false return SponsorBlock.SegmentAction.Disable
end if end if
option = category.option option = category.option
@@ -74,8 +74,8 @@ namespace SponsorBlock
return invalid return invalid
end if end if
' categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "poi_highlight", "filler", "exclusive_access"] ' categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "hook", "music_offtopic", "poi_highlight", "filler", "exclusive_access"]
categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "music_offtopic", "poi_highlight", "filler"] categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "hook", "music_offtopic", "poi_highlight", "filler"]
' actionTypes = ["skip", "mute", "chapter", "full", "poi"] ' actionTypes = ["skip", "mute", "chapter", "full", "poi"]
actionTypes = ["skip", "mute", "poi"] actionTypes = ["skip", "mute", "poi"]
+3
View File
@@ -166,6 +166,9 @@
preview: { preview: {
option: "manual_skip", option: "manual_skip",
}, },
hook: {
option: "manual_skip",
},
filler: { filler: {
option: "manual_skip", option: "manual_skip",
}, },
@@ -8,6 +8,7 @@
"intro", "intro",
"outro", "outro",
"preview", "preview",
"hook",
"filler", "filler",
"music_offtopic", "music_offtopic",
], ],
@@ -49,11 +50,17 @@
color: "#0202EDB3", color: "#0202EDB3",
}, },
preview: { preview: {
title: "Preview/Recap/Hook", title: "Preview/Recap",
short_title: "Preview/Recap", short_title: "Preview/Recap",
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"], options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
color: "#008FD6B3", color: "#008FD6B3",
}, },
hook: {
title: "Hook/Greetings",
short_title: "Hook/Greetings",
options: ["auto_skip", "manual_skip", "show_in_seekbar", "disable"],
color: "#395699B3",
},
filler: { filler: {
title: "Filler Tangent/Jokes", title: "Filler Tangent/Jokes",
short_title: "Filler", short_title: "Filler",
+4 -4
View File
@@ -720,14 +720,14 @@
<source>Endcards/Credits</source> <source>Endcards/Credits</source>
<translation>Endcard/Abspann</translation> <translation>Endcard/Abspann</translation>
</message> </message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Vorschau/Rückschau/Hook</translation>
</message>
<message> <message>
<source>Preview/Recap</source> <source>Preview/Recap</source>
<translation>Vorschau/Rückschau</translation> <translation>Vorschau/Rückschau</translation>
</message> </message>
<message>
<source>Hook/Greetings</source>
<translation>Hook/Begrüßungen</translation>
</message>
<message> <message>
<source>Filler</source> <source>Filler</source>
<translation>Füllwörter/ Zeitverschwendung</translation> <translation>Füllwörter/ Zeitverschwendung</translation>
+4 -4
View File
@@ -1060,14 +1060,14 @@
<source>Endcards/Credits</source> <source>Endcards/Credits</source>
<translation>Endcards/Credits</translation> <translation>Endcards/Credits</translation>
</message> </message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Preview/Recap/Hook</translation>
</message>
<message> <message>
<source>Preview/Recap</source> <source>Preview/Recap</source>
<translation>Preview/Recap</translation> <translation>Preview/Recap</translation>
</message> </message>
<message>
<source>Hook/Greetings</source>
<translation>Hook/Greetings</translation>
</message>
<message> <message>
<source>Filler Tangent/Jokes</source> <source>Filler Tangent/Jokes</source>
<translation>Filler Tangent/Jokes</translation> <translation>Filler Tangent/Jokes</translation>
+4 -4
View File
@@ -624,6 +624,10 @@
<source>Preview/Recap</source> <source>Preview/Recap</source>
<translation>Vista previa/Resumen</translation> <translation>Vista previa/Resumen</translation>
</message> </message>
<message>
<source>Hook/Greetings</source>
<translation>Gancho/Saludos</translation>
</message>
<message> <message>
<source>Added to queue</source> <source>Added to queue</source>
<translation>Añadir a la cola</translation> <translation>Añadir a la cola</translation>
@@ -1128,10 +1132,6 @@
<source>Endcards/Credits</source> <source>Endcards/Credits</source>
<translation>Tarjeta final/Créditos</translation> <translation>Tarjeta final/Créditos</translation>
</message> </message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Vista previa/Resumen/Gancho</translation>
</message>
<message> <message>
<source>Press and hold Options (*) to open the queue</source> <source>Press and hold Options (*) to open the queue</source>
<translation>Mantén pulsado Opciones (*) para abrir la cola</translation> <translation>Mantén pulsado Opciones (*) para abrir la cola</translation>
+2 -2
View File
@@ -1201,8 +1201,8 @@
<translation>Avance/Resumen</translation> <translation>Avance/Resumen</translation>
</message> </message>
<message> <message>
<source>Preview/Recap/Hook</source> <source>Hook/Greetings</source>
<translation>Avance/Resumen/Gancho</translation> <translation>Gancho/Saludos</translation>
</message> </message>
<message> <message>
<source>Sponsor</source> <source>Sponsor</source>
+4 -4
View File
@@ -912,14 +912,14 @@
<source>Endcards/Credits</source> <source>Endcards/Credits</source>
<translation>Écrans de fin/Crédits</translation> <translation>Écrans de fin/Crédits</translation>
</message> </message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Aperçu/Récapitulatif/Accroche</translation>
</message>
<message> <message>
<source>Preview/Recap</source> <source>Preview/Recap</source>
<translation>Aperçu/Récapitulatif</translation> <translation>Aperçu/Récapitulatif</translation>
</message> </message>
<message>
<source>Hook/Greetings</source>
<translation>Accroche/Salutations</translation>
</message>
<message> <message>
<source>Filler Tangent/Jokes</source> <source>Filler Tangent/Jokes</source>
<translation>Digressions/Blagues</translation> <translation>Digressions/Blagues</translation>
+4 -4
View File
@@ -788,10 +788,6 @@
<source>Endcards/Credits</source> <source>Endcards/Credits</source>
<translation>Cards finais/Créditos</translation> <translation>Cards finais/Créditos</translation>
</message> </message>
<message>
<source>Preview/Recap/Hook</source>
<translation>Pré-visualização/Recapitulação/Gancho</translation>
</message>
<message> <message>
<source>Intermission/Intro Animation</source> <source>Intermission/Intro Animation</source>
<translation>Intermissão/Animação de introdução</translation> <translation>Intermissão/Animação de introdução</translation>
@@ -800,6 +796,10 @@
<source>Preview/Recap</source> <source>Preview/Recap</source>
<translation>Pré-visualização/Recapitulação</translation> <translation>Pré-visualização/Recapitulação</translation>
</message> </message>
<message>
<source>Hook/Greetings</source>
<translation>Gancho/Saudações</translation>
</message>
<message> <message>
<source>Filler Tangent/Jokes</source> <source>Filler Tangent/Jokes</source>
<translation>Preenchimento Tangente/Piadas</translation> <translation>Preenchimento Tangente/Piadas</translation>
+2 -2
View File
@@ -353,8 +353,8 @@ namespace Locale
IntroTitle = "Intermission/Intro Animation" IntroTitle = "Intermission/Intro Animation"
IntroShortTitle = "Intermission" IntroShortTitle = "Intermission"
OutroTitle = "Endcards/Credits" OutroTitle = "Endcards/Credits"
PreviewTitle = "Preview/Recap/Hook" PreviewTitle = "Preview/Recap"
PreviewShortTitle = "Preview/Recap" HookTitle = "Hook/Greetings"
FillerTitle = "Filler Tangent/Jokes" FillerTitle = "Filler Tangent/Jokes"
FillerShortTitle = "Filler" FillerShortTitle = "Filler"
ChapterTitle = "Chapter" ChapterTitle = "Chapter"
+9
View File
@@ -29,6 +29,15 @@ export class ManifestEditPlugin implements CompilerPlugin {
private originalManifestContent?: string; private originalManifestContent?: string;
beforeProgramCreate(builder: ProgramBuilder) { beforeProgramCreate(builder: ProgramBuilder) {
// The language server loads this plugin too (VS Code + bsc-lsp), and its revalidate cycle would
// restore a stale cached copy of the manifest over genuine build edits. The LSP builds no-emit
// with showDiagnosticsInConsole off (it reports over the protocol); builds and bslint leave it
// on. So that flag marks the analysis-only editor pass — skip the manifest rewrite there.
// @ts-ignore
if (builder.options.showDiagnosticsInConsole === false) {
return;
}
const manifestPath = path.join(builder.options.rootDir!, "manifest") const manifestPath = path.join(builder.options.rootDir!, "manifest")
let originalManifestContent = fs.readFileSync(manifestPath, { encoding: 'utf8', flag: 'r' }) let originalManifestContent = fs.readFileSync(manifestPath, { encoding: 'utf8', flag: 'r' })