mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-12 06:27:14 +03:00
store response status 200
This commit is contained in:
@@ -833,7 +833,6 @@ async function sponsorsLookup(keepOldSubmissions = true) {
|
||||
const hashParams = getHashParams();
|
||||
if (hashParams.requiredSegment) extraRequestData.requiredSegment = hashParams.requiredSegment;
|
||||
|
||||
// Check for hashPrefix setting
|
||||
const hashPrefix = (await utils.getHash(sponsorVideoID, 1)).slice(0, 4) as VideoID & HashedValue;
|
||||
const response = await utils.asyncRequestToServer('GET', "/api/skipSegments/" + hashPrefix, {
|
||||
categories,
|
||||
@@ -842,6 +841,9 @@ async function sponsorsLookup(keepOldSubmissions = true) {
|
||||
...extraRequestData
|
||||
});
|
||||
|
||||
// store last response status
|
||||
lastResponseStatus = response?.status;
|
||||
|
||||
if (response?.ok) {
|
||||
const recievedSegments: SponsorTime[] = JSON.parse(response.responseText)
|
||||
?.filter((video) => video.videoID === sponsorVideoID)
|
||||
@@ -910,7 +912,6 @@ async function sponsorsLookup(keepOldSubmissions = true) {
|
||||
updatePreviewBar();
|
||||
}
|
||||
} else {
|
||||
lastResponseStatus = response?.status;
|
||||
if (lastResponseStatus === 404) {
|
||||
retryFetch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user