Skip to content

Commit

Permalink
Remove unused auto refetch segments option
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Dec 24, 2024
1 parent dc9c08f commit 778b433
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
14 changes: 0 additions & 14 deletions public/options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,6 @@
<div class="small-description">__MSG_whatForceChannelCheck__</div>
</div>

<div data-type="toggle" data-sync="refetchWhenNotFound">
<div class="switch-container">
<label class="switch">
<input id="refetchWhenNotFound" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="refetchWhenNotFound">
__MSG_enableRefetchWhenNotFound__
</label>
</div>

<div class="small-description">__MSG_whatRefetchWhenNotFound__</div>
</div>

<div data-type="toggle" data-sync="showCategoryWithoutPermission">
<div class="switch-container">
<label class="switch">
Expand Down
2 changes: 0 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ interface SBConfig {
audioNotificationOnSkip: boolean;
checkForUnlistedVideos: boolean;
testingServer: boolean;
refetchWhenNotFound: boolean;
ytInfoPermissionGranted: boolean;
allowExpirements: boolean;
showDonationLink: boolean;
Expand Down Expand Up @@ -312,7 +311,6 @@ const syncDefaults = {
audioNotificationOnSkip: false,
checkForUnlistedVideos: false,
testingServer: false,
refetchWhenNotFound: true,
ytInfoPermissionGranted: false,
allowExpirements: true,
showDonationLink: true,
Expand Down
21 changes: 0 additions & 21 deletions src/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1312,27 +1312,6 @@ async function lockedCategoriesLookup(): Promise<void> {
}
}

function retryFetch(errorCode: number): void {
sponsorDataFound = false;
if (!Config.config.refetchWhenNotFound) return;

if (retryFetchTimeout) clearTimeout(retryFetchTimeout);
if ((errorCode !== 404 && retryCount > 1) || (errorCode !== 404 && retryCount > 10)) {
// Too many errors (50x), give up
return;
}

retryCount++;

const delay = errorCode === 404 ? (30000 + Math.random() * 30000) : (2000 + Math.random() * 10000);
retryFetchTimeout = setTimeout(() => {
if (getVideoID() && sponsorTimes?.length === 0
|| sponsorTimes.every((segment) => segment.source !== SponsorSourceType.Server)) {
// sponsorsLookup();
}
}, delay);
}

/**
* Only should be used when it is okay to skip a sponsor when in the middle of it
*
Expand Down

0 comments on commit 778b433

Please sign in to comment.