[skip-ci] SponsorBlock "Hook/Greetings" category
This commit is contained in:
1 parent
7a976bbe3d
commit
62dcc14042
16 files changed
+62
-32
No files matched your search
@@ -178,6 +178,16 @@ function MigrateExistingPreferences(userPrefs as object) as boolean
|
||||
isDirty = true
|
||||
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)
|
||||
|
||||
#if DEBUG
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
user prefs saved need to be migrated. If the version is less than the
|
||||
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="preferenceFields" type="assocarray" />
|
||||
<function name="GetUserPreferences" />
|
||||
|
||||
@@ -92,7 +92,7 @@ end function
|
||||
function GetOptionForSegment(segment as object, categories as object) as string
|
||||
category = categories[segment.category]
|
||||
if not IsAssociativeArray(category)
|
||||
return false
|
||||
return SponsorBlock.SegmentAction.Disable
|
||||
end if
|
||||
|
||||
option = category.option
|
||||
|
||||
@@ -74,8 +74,8 @@ namespace SponsorBlock
|
||||
return invalid
|
||||
end if
|
||||
|
||||
' categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "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", "exclusive_access"]
|
||||
categories = ["sponsor", "selfpromo", "interaction", "intro", "outro", "preview", "hook", "music_offtopic", "poi_highlight", "filler"]
|
||||
' actionTypes = ["skip", "mute", "chapter", "full", "poi"]
|
||||
actionTypes = ["skip", "mute", "poi"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user