mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
Don't fail when the YouTube API errors
This commit is contained in:
@@ -411,6 +411,9 @@ module.exports = async function postSkipSegments(req, res) {
|
|||||||
YouTubeAPI.listVideos(videoID, (err, data) => resolve({err, data}));
|
YouTubeAPI.listVideos(videoID, (err, data) => resolve({err, data}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
logger.error("Error while submitting when connecting to YouTube API: " + err);
|
||||||
|
} else {
|
||||||
//get all segments for this video and user
|
//get all segments for this video and user
|
||||||
let allSubmittedByUser = db.prepare('all', "SELECT startTime, endTime FROM sponsorTimes WHERE userID = ? and videoID = ? and votes > -1", [userID, videoID]);
|
let allSubmittedByUser = db.prepare('all', "SELECT startTime, endTime FROM sponsorTimes WHERE userID = ? and videoID = ? and votes > -1", [userID, videoID]);
|
||||||
let allSegmentTimes = [];
|
let allSegmentTimes = [];
|
||||||
@@ -444,6 +447,7 @@ module.exports = async function postSkipSegments(req, res) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const segmentInfo of segments) {
|
for (const segmentInfo of segments) {
|
||||||
//this can just be a hash of the data
|
//this can just be a hash of the data
|
||||||
|
|||||||
Reference in New Issue
Block a user