mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 21:17:20 +03:00
Added migration for auto skip option
This commit is contained in:
@@ -84,23 +84,6 @@
|
|||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<div option-type="toggle" toggle-type="reverse" sync-option="disableAutoSkip">
|
|
||||||
<label class="switch-container" label-name="__MSG_autoSkip__">
|
|
||||||
<label class="switch">
|
|
||||||
<input type="checkbox" checked>
|
|
||||||
<span class="slider round"></span>
|
|
||||||
</label>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<div class="small-description">__MSG_autoSkipDescription__</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br/>
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<div option-type="keybind-change" sync-option="startSponsorKeybind">
|
<div option-type="keybind-change" sync-option="startSponsorKeybind">
|
||||||
<div class="option-button trigger-button">
|
<div class="option-button trigger-button">
|
||||||
__MSG_setStartSponsorShortcut__
|
__MSG_setStartSponsorShortcut__
|
||||||
|
|||||||
@@ -233,11 +233,14 @@ function fetchConfig() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function migrateOldFormats() { // Convert sponsorTimes format
|
function migrateOldFormats() {
|
||||||
for (const key in Config.localConfig) {
|
if (Config.config["disableAutoSkip"]) {
|
||||||
if (key.startsWith("sponsorTimes") && key !== "sponsorTimes" && key !== "sponsorTimesContributed") {
|
for (const selection of Config.config.categorySelections) {
|
||||||
Config.config.sponsorTimes.set(key.substr(12), Config.config[key]);
|
if (selection.name === "sponsor") {
|
||||||
delete Config.config[key];
|
selection.option = CategorySkipOption.ManualSkip;
|
||||||
|
|
||||||
|
chrome.storage.sync.remove("disableAutoSkip");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ var seekListenerSetUp = false
|
|||||||
var hiddenSponsorTimes: number[] = [];
|
var hiddenSponsorTimes: number[] = [];
|
||||||
|
|
||||||
/** @type {Array[boolean]} Has the sponsor been skipped */
|
/** @type {Array[boolean]} Has the sponsor been skipped */
|
||||||
var sponsorSkipped = [];
|
var sponsorSkipped: boolean[] = [];
|
||||||
|
|
||||||
//the video
|
//the video
|
||||||
var video: HTMLVideoElement;
|
var video: HTMLVideoElement;
|
||||||
|
|||||||
Reference in New Issue
Block a user