mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-12 06:27:10 +03:00
Merge pull request #176 from ajayyy/experimental
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}));
|
||||
});
|
||||
|
||||
if (err) {
|
||||
logger.error("Error while submitting when connecting to YouTube API: " + err);
|
||||
} else {
|
||||
//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 allSegmentTimes = [];
|
||||
@@ -444,6 +447,7 @@ module.exports = async function postSkipSegments(req, res) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const segmentInfo of segments) {
|
||||
//this can just be a hash of the data
|
||||
|
||||
Reference in New Issue
Block a user