Fix chapter importing and lock fetching after 404

This commit is contained in:
Ajay
2023-01-29 17:53:37 -05:00
parent c9fc22e51e
commit e3bedbf5f2

View File

@@ -1092,20 +1092,7 @@ async function sponsorsLookup(keepOldSubmissions = true) {
source: SponsorSourceType.Server
}))
?.sort((a, b) => a.segment[0] - b.segment[0]);
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 (recievedSegments && recievedSegments.length) {
if (showChapterMessage) {
const chapterSegments = recievedSegments.filter((s) => s.actionType === ActionType.Chapter);
if (chapterSegments.length > 3) {
@@ -1185,6 +1172,9 @@ async function sponsorsLookup(keepOldSubmissions = true) {
//otherwise the listener can handle it
updatePreviewBar();
}
} else {
retryFetch(404);
}
} else {
retryFetch(lastResponseStatus);
}