Compare commits

..

6 Commits
3.0.1 ... 3.0.2

Author SHA1 Message Date
Ajay Ramachandran
d20a44751c bump version 2021-08-23 03:08:01 -04:00
Ajay Ramachandran
15706fd3c4 Fix issue with early highlight breaking skipping 2021-08-22 20:47:46 -04:00
Ajay Ramachandran
a9e43f95f5 Fix highlight auto skipping on music videos 2021-08-22 19:03:24 -04:00
Ajay Ramachandran
11fe87a09e Fix highlight category info appearing to new users 2021-08-22 19:03:05 -04:00
Ajay Ramachandran
52741b2c0a Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2021-08-22 14:13:03 -04:00
Ajay Ramachandran
09b18a4f6d Fix auto skip on music videos for show overlay 2021-08-22 14:13:02 -04:00
3 changed files with 12 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "3.0.1",
"version": "3.0.2",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",

View File

@@ -81,7 +81,7 @@ chrome.runtime.onInstalled.addListener(function () {
//save this UUID
Config.config.userID = newUserID;
Config.config.highlightCategoryUpdate = false;
Config.config.highlightCategoryUpdate = true;
}
}, 1500);
});

View File

@@ -444,8 +444,7 @@ function startSponsorSchedule(includeIntersectingSegments = false, currentTime?:
}
// Don't skip if this category should not be skipped
if (utils.getCategorySelection(currentSkip.category)?.option === CategorySkipOption.ShowOverlay
&& skipInfo.array !== sponsorTimesSubmitting) return;
if (!shouldSkip(currentSkip) && skipInfo.array !== sponsorTimesSubmitting) return;
const skippingFunction = () => {
let forcedSkipTime: number = null;
@@ -962,14 +961,14 @@ function getNextSkipIndex(currentTime: number, includeIntersectingSegments: bool
if ((minUnsubmittedSponsorTimeIndex === -1 && minSponsorTimeIndex !== -1) ||
sponsorStartTimes[minSponsorTimeIndex] < unsubmittedSponsorStartTimes[minUnsubmittedSponsorTimeIndex]) {
return {
array: sponsorTimes,
array: sponsorTimes.filter((segment) => getCategoryActionType(segment.category) === CategoryActionType.Skippable),
index: minSponsorTimeIndex,
endIndex: endTimeIndex,
openNotice: true
};
} else {
return {
array: sponsorTimesSubmitting,
array: sponsorTimesSubmitting.filter((segment) => getCategoryActionType(segment.category) === CategoryActionType.Skippable),
index: minUnsubmittedSponsorTimeIndex,
endIndex: previewEndTimeIndex,
openNotice: false
@@ -1038,7 +1037,7 @@ function getStartTimes(sponsorTimes: SponsorTime[], includeIntersectingSegments:
if ((minimum === undefined
|| ((includeNonIntersectingSegments && sponsorTimes[i].segment[0] >= minimum)
|| (includeIntersectingSegments && sponsorTimes[i].segment[0] < minimum && sponsorTimes[i].segment[1] > minimum)))
&& (!onlySkippableSponsors || utils.getCategorySelection(sponsorTimes[i].category).option !== CategorySkipOption.ShowOverlay)
&& (!onlySkippableSponsors || shouldSkip(sponsorTimes[i]))
&& (!hideHiddenSponsors || sponsorTimes[i].hidden === SponsorHideType.Visible)
&& getCategoryActionType(sponsorTimes[i].category) === CategoryActionType.Skippable) {
@@ -1190,6 +1189,12 @@ function createButton(baseID: string, title: string, callback: () => void, image
function shouldAutoSkip(segment: SponsorTime): boolean {
return utils.getCategorySelection(segment.category)?.option === CategorySkipOption.AutoSkip ||
(Config.config.autoSkipOnMusicVideos && sponsorTimes.some((s) => s.category === "music_offtopic")
&& getCategoryActionType(segment.category) === CategoryActionType.Skippable);
}
function shouldSkip(segment: SponsorTime): boolean {
return utils.getCategorySelection(segment.category)?.option !== CategorySkipOption.ShowOverlay ||
(Config.config.autoSkipOnMusicVideos && sponsorTimes.some((s) => s.category === "music_offtopic"));
}