mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Fix chapter importing and lock fetching after 404
This commit is contained in:
@@ -1092,20 +1092,7 @@ async function sponsorsLookup(keepOldSubmissions = true) {
|
|||||||
source: SponsorSourceType.Server
|
source: SponsorSourceType.Server
|
||||||
}))
|
}))
|
||||||
?.sort((a, b) => a.segment[0] - b.segment[0]);
|
?.sort((a, b) => a.segment[0] - b.segment[0]);
|
||||||
if (!recievedSegments || !recievedSegments.length) {
|
if (recievedSegments && recievedSegments.length) {
|
||||||
// return if no video found
|
|
||||||
chrome.runtime.sendMessage({
|
|
||||||
message: "infoUpdated",
|
|
||||||
found: false,
|
|
||||||
status: lastResponseStatus,
|
|
||||||
sponsorTimes: sponsorTimes,
|
|
||||||
time: video.currentTime,
|
|
||||||
onMobileYouTube
|
|
||||||
});
|
|
||||||
retryFetch(404);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showChapterMessage) {
|
if (showChapterMessage) {
|
||||||
const chapterSegments = recievedSegments.filter((s) => s.actionType === ActionType.Chapter);
|
const chapterSegments = recievedSegments.filter((s) => s.actionType === ActionType.Chapter);
|
||||||
if (chapterSegments.length > 3) {
|
if (chapterSegments.length > 3) {
|
||||||
@@ -1185,6 +1172,9 @@ async function sponsorsLookup(keepOldSubmissions = true) {
|
|||||||
//otherwise the listener can handle it
|
//otherwise the listener can handle it
|
||||||
updatePreviewBar();
|
updatePreviewBar();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
retryFetch(404);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
retryFetch(lastResponseStatus);
|
retryFetch(lastResponseStatus);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user