Merge pull request #650 from ajayyy/improvements

Improvements
This commit is contained in:
Ajay Ramachandran 2021-03-07 14:23:28 -05:00 committed by GitHub
commit 8de4f904a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 22 deletions

View file

@ -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"

View file

@ -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";

View file

@ -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");

View file

@ -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({

View file

@ -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;