mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-09-20 04:53:43 +02:00
commit
8de4f904a5
5 changed files with 7 additions and 22 deletions
|
@ -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"
|
||||
|
|
|
@ -127,7 +127,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
|
|||
|
||||
render(): React.ReactElement {
|
||||
const noticeStyle: React.CSSProperties = {
|
||||
zIndex: 50 + this.amountOfPreviousNotices
|
||||
zIndex: 1000 + this.amountOfPreviousNotices
|
||||
}
|
||||
if (this.contentContainer().onMobileYouTube) {
|
||||
noticeStyle.bottom = "4em";
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
@ -1281,7 +1281,7 @@ function openInfoMenu() {
|
|||
const settings = <HTMLImageElement> popup.querySelector("#sbPopupIconSettings");
|
||||
const edit = <HTMLImageElement> popup.querySelector("#sbPopupIconEdit");
|
||||
const check = <HTMLImageElement> 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");
|
||||
|
|
17
src/popup.ts
17
src/popup.ts
|
@ -396,7 +396,7 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||
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<void> {
|
|||
});
|
||||
}
|
||||
|
||||
//converts time in seconds to minutes:seconds
|
||||
function getFormattedTime(seconds) {
|
||||
const minutes = Math.floor(seconds / 60);
|
||||
const secondsDisplayNumber = Math.round(seconds - minutes * 60);
|
||||
let secondsDisplay = String(secondsDisplayNumber);
|
||||
if (secondsDisplayNumber < 10) {
|
||||
//add a zero
|
||||
secondsDisplay = "0" + secondsDisplay;
|
||||
}
|
||||
|
||||
const formatted = minutes + ":" + secondsDisplay;
|
||||
|
||||
return formatted;
|
||||
}
|
||||
|
||||
function whitelistChannel() {
|
||||
//get the channel url
|
||||
messageHandler.query({
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue