From d1a7209d696430126237fd9d84bb6d2e5ff7e2fa Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 14 Feb 2021 14:22:28 -0500 Subject: [PATCH 1/8] Switch from round to floor --- src/popup.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/popup.ts b/src/popup.ts index f28589a7..f4fd0b47 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -598,7 +598,7 @@ async function runThePopup(messageListener?: MessageListener): Promise { //converts time in seconds to minutes:seconds function getFormattedTime(seconds) { const minutes = Math.floor(seconds / 60); - const secondsDisplayNumber = Math.round(seconds - minutes * 60); + const secondsDisplayNumber = Math.floor(seconds - minutes * 60); let secondsDisplay = String(secondsDisplayNumber); if (secondsDisplayNumber < 10) { //add a zero From e3b0be23a7486c22117a8842e92329728b4ec0a1 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 14 Feb 2021 14:27:59 -0500 Subject: [PATCH 2/8] Show decimals in popup --- src/popup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/popup.ts b/src/popup.ts index f4fd0b47..5f28bccb 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -598,8 +598,8 @@ async function runThePopup(messageListener?: MessageListener): Promise { //converts time in seconds to minutes:seconds function getFormattedTime(seconds) { const minutes = Math.floor(seconds / 60); - const secondsDisplayNumber = Math.floor(seconds - minutes * 60); - let secondsDisplay = String(secondsDisplayNumber); + const secondsDisplayNumber = seconds - minutes * 60; + let secondsDisplay = secondsDisplayNumber.toFixed(3); if (secondsDisplayNumber < 10) { //add a zero secondsDisplay = "0" + secondsDisplay; From 7b65b73711c0e78022290d49c2ef1923d89970f2 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sun, 14 Feb 2021 20:12:45 -0500 Subject: [PATCH 3/8] Increase notice z index Resolves #642 --- src/components/SkipNoticeComponent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index b4f31932..01b2a15e 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -127,7 +127,7 @@ class SkipNoticeComponent extends React.Component Date: Thu, 18 Feb 2021 21:23:00 -0500 Subject: [PATCH 4/8] Lower retry frequency --- src/content.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content.ts b/src/content.ts index e6e87704..42627dea 100644 --- a/src/content.ts +++ b/src/content.ts @@ -647,12 +647,12 @@ async function sponsorsLookup(id: string) { sponsorLookupRetries = 0; } else if (response?.status === 404) { retryFetch(id); - } else if (sponsorLookupRetries < 90 && !recheckStarted) { + } else if (sponsorLookupRetries < 15 && !recheckStarted) { recheckStarted = true; //TODO lower when server becomes better (back to 1 second) //some error occurred, try again in a second - setTimeout(() => sponsorsLookup(id), 5000 + Math.random() * 15000); + setTimeout(() => sponsorsLookup(id), 5000 + Math.random() * 15000 + 5000 * sponsorLookupRetries); sponsorLookupRetries++; } From cad77aef8e5e982924202720cb038cf934450677 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 18 Feb 2021 21:30:09 -0500 Subject: [PATCH 5/8] Add missing status code from known list --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index fd47b27c..b16bb438 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -290,7 +290,7 @@ class Utils { let errorMessage = ""; const postFix = (responseText ? "\n\n" + responseText : ""); - if([400, 429, 409, 502, 0].includes(statusCode)) { + if([400, 429, 409, 502, 503, 0].includes(statusCode)) { //treat them the same if (statusCode == 503) statusCode = 502; From bbc94e9404562d77bc9646dcfdc1aca0dd6fa57d Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 20 Feb 2021 15:53:48 -0500 Subject: [PATCH 6/8] Update non music section description --- public/_locales/en/messages.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 16f9e266..51eceee8 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -517,7 +517,7 @@ "message": "Music: Non-Music Section" }, "category_music_offtopic_description": { - "message": "Only for use in music videos. This includes introductions or outros in music videos." + "message": "Only for use in music videos. This only should be used for sections of music videos that aren't already covered by another category." }, "category_music_offtopic_short": { "message": "Non-Music" From 50aee79f3230b18cf03d9171677f997f7625c626 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 20 Feb 2021 15:55:56 -0500 Subject: [PATCH 7/8] Add hours to popup time --- src/popup.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/popup.ts b/src/popup.ts index 5f28bccb..347678f3 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -396,7 +396,7 @@ async function runThePopup(messageListener?: MessageListener): Promise { extraInfo = " (" + chrome.i18n.getMessage("hiddenDueToDuration") + ")"; } - sponsorTimeButton.innerText = prefix + getFormattedTime(segmentTimes[i].segment[0]) + " " + chrome.i18n.getMessage("to") + " " + getFormattedTime(segmentTimes[i].segment[1]) + extraInfo; + sponsorTimeButton.innerText = prefix + utils.getFormattedTime(segmentTimes[i].segment[0], true) + " " + chrome.i18n.getMessage("to") + " " + utils.getFormattedTime(segmentTimes[i].segment[1], true) + extraInfo; const categoryColorCircle = document.createElement("span"); categoryColorCircle.id = "sponsorTimesCategoryColorCircle" + UUID; @@ -595,21 +595,6 @@ async function runThePopup(messageListener?: MessageListener): Promise { }); } - //converts time in seconds to minutes:seconds - function getFormattedTime(seconds) { - const minutes = Math.floor(seconds / 60); - const secondsDisplayNumber = seconds - minutes * 60; - let secondsDisplay = secondsDisplayNumber.toFixed(3); - if (secondsDisplayNumber < 10) { - //add a zero - secondsDisplay = "0" + secondsDisplay; - } - - const formatted = minutes + ":" + secondsDisplay; - - return formatted; - } - function whitelistChannel() { //get the channel url messageHandler.query({ From 9474424a1eb23f332144c92e3d18dd279e2f4c6d Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Mon, 22 Feb 2021 22:17:23 -0500 Subject: [PATCH 8/8] make popup icons consistent --- src/content.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content.ts b/src/content.ts index 42627dea..178eda57 100644 --- a/src/content.ts +++ b/src/content.ts @@ -1281,7 +1281,7 @@ function openInfoMenu() { const settings = popup.querySelector("#sbPopupIconSettings"); const edit = popup.querySelector("#sbPopupIconEdit"); const check = popup.querySelector("#sbPopupIconCheck"); - logo.src = chrome.extension.getURL("icons/LogoSponsorBlocker256px.png"); + logo.src = chrome.extension.getURL("icons/IconSponsorBlocker256px.png"); settings.src = chrome.extension.getURL("icons/settings.svg"); edit.src = chrome.extension.getURL("icons/pencil.svg"); check.src = chrome.extension.getURL("icons/check.svg");