From 6e23650a99765cf15084a8d13c0af218fbd3af6a Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 22 Feb 2022 01:01:27 -0500 Subject: [PATCH 1/4] Add category pill right away Fix #1199 --- src/content.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/content.ts b/src/content.ts index 0b8233dd..26a2b772 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1934,6 +1934,11 @@ async function sendSubmitMessage() { sponsorTimesSubmitting = []; updatePreviewBar(); + + const fullVideoSegment = sponsorTimes.filter((time) => time.actionType === ActionType.Full)[0]; + if (fullVideoSegment) { + categoryPill?.setSegment(fullVideoSegment); + } } else { // Show that the upload failed playerButtons.submit.button.style.animation = "unset"; From 30fe40a5234b69237b61a99899496cbba4f89c48 Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 22 Feb 2022 01:05:57 -0500 Subject: [PATCH 2/4] Fix minimum duration Fix #1202 --- src/content.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index 26a2b772..358144cd 100644 --- a/src/content.ts +++ b/src/content.ts @@ -756,7 +756,7 @@ async function sponsorsLookup(id: string, keepOldSubmissions = true) { // Hide all submissions smaller than the minimum duration if (Config.config.minDuration !== 0) { for (const segment of sponsorTimes) { - const duration = segment[1] - segment[0]; + const duration = segment.segment[1] - segment.segment[0]; if (duration > 0 && duration < Config.config.minDuration) { segment.hidden = SponsorHideType.MinimumDuration; } From fd5ab9f1533868e9cbb3bbe14653538a2581964f Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 22 Feb 2022 01:06:09 -0500 Subject: [PATCH 3/4] bump version --- manifest/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest/manifest.json b/manifest/manifest.json index 2862af76..18cf3ad7 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "SponsorBlock", - "version": "4.1.3", + "version": "4.1.4", "default_locale": "en", "description": "__MSG_Description__", "homepage_url": "https://sponsor.ajay.app", From 84a234f9b63ea9cfa95aec85db7980e337ce5fec Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 22 Feb 2022 01:21:18 -0500 Subject: [PATCH 4/4] Fix full video saving old times Fix #1198 --- src/components/SponsorTimeEditComponent.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 4278ecb6..79922239 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -381,21 +381,21 @@ class SponsorTimeEditComponent extends React.Component): void { const sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index]; - this.handleReplacingLostTimes(sponsorTime.category, event.target.value as ActionType); + this.handleReplacingLostTimes(sponsorTime.category, event.target.value as ActionType, sponsorTime); this.saveEditTimes(); } - private handleReplacingLostTimes(category: Category, actionType: ActionType): void { + private handleReplacingLostTimes(category: Category, actionType: ActionType, segment: SponsorTime): void { if (CompileConfig.categorySupport[category]?.includes(ActionType.Poi)) { if (this.previousSkipType !== ActionType.Poi) { - this.timesBeforeChanging = [null, utils.getFormattedTimeToSeconds(this.state.sponsorTimeEdits[1])]; + this.timesBeforeChanging = [null, segment.segment[1]]; } this.setTimeTo(1, null); @@ -410,12 +410,13 @@ class SponsorTimeEditComponent extends React.Component