diff --git a/maze-utils b/maze-utils index a05b8140..86d10d17 160000 --- a/maze-utils +++ b/maze-utils @@ -1 +1 @@ -Subproject commit a05b8140da0a0b0255b5680ef7bc2fe5e2ca2feb +Subproject commit 86d10d179b91a71390b53ee6303caf9151d155db diff --git a/src/content.ts b/src/content.ts index 367c8dbc..6d40860b 100644 --- a/src/content.ts +++ b/src/content.ts @@ -256,7 +256,7 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo // it will assume the page is not a video page and stop the refresh animation sendResponse({ hasVideo: getVideoID() != null }); // fetch segments - sponsorsLookup(false); + sponsorsLookup(false, true); break; case "unskip": @@ -971,14 +971,14 @@ function setupCategoryPill() { categoryPill.attachToPage(voteAsync); } -async function sponsorsLookup(keepOldSubmissions = true) { +async function sponsorsLookup(keepOldSubmissions = true, ignoreServerCache = false) { if (lookupWaiting) return; //there is still no video here if (!getVideo()) { lookupWaiting = true; setTimeout(() => { lookupWaiting = false; - sponsorsLookup() + sponsorsLookup(keepOldSubmissions, ignoreServerCache) }, 100); return; } @@ -995,7 +995,7 @@ async function sponsorsLookup(keepOldSubmissions = true) { actionTypes: getEnabledActionTypes(), userAgent: `${chrome.runtime.id}`, ...extraRequestData - }); + }, ignoreServerCache); // store last response status lastResponseStatus = response?.status; @@ -1810,7 +1810,7 @@ function startOrEndTimingNewSegment() { Config.forceLocalUpdate("unsubmittedSegments"); // Make sure they know if someone has already submitted something it while they were watching - sponsorsLookup(); + sponsorsLookup(true, true); updateEditButtonsOnPlayer(); updateSponsorTimesSubmitting(false); diff --git a/src/utils/requests.ts b/src/utils/requests.ts index ea5fd0f7..4ed5daa4 100644 --- a/src/utils/requests.ts +++ b/src/utils/requests.ts @@ -9,8 +9,8 @@ import { FetchResponse, sendRequestToCustomServer } from "../../maze-utils/src/b * @param address The address to add to the SponsorBlock server address * @param callback */ -export function asyncRequestToCustomServer(type: string, url: string, data = {}): Promise { - return sendRequestToCustomServer(type, url, data); +export function asyncRequestToCustomServer(type: string, url: string, data = {}, ignoreServerCache = false): Promise { + return sendRequestToCustomServer(type, url, data, ignoreServerCache); } /** @@ -20,10 +20,10 @@ export function asyncRequestToCustomServer(type: string, url: string, data = {}) * @param address The address to add to the SponsorBlock server address * @param callback */ -export async function asyncRequestToServer(type: string, address: string, data = {}): Promise { +export async function asyncRequestToServer(type: string, address: string, data = {}, ignoreServerCache = false): Promise { const serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress; - return await (asyncRequestToCustomServer(type, serverAddress + address, data)); + return await (asyncRequestToCustomServer(type, serverAddress + address, data, ignoreServerCache)); } /**