mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-19 22:18:35 +03:00
Merge branch 'master' into 147-add-cache-for-gettopusers
This commit is contained in:
7
src/utils/getSubmissionUUID.js
Normal file
7
src/utils/getSubmissionUUID.js
Normal file
@@ -0,0 +1,7 @@
|
||||
const getHash = require('./getHash.js');
|
||||
|
||||
module.exports = function getSubmissionUUID(videoID, category, userID,
|
||||
startTime, endTime) {
|
||||
return getHash('v2-categories' + videoID + startTime + endTime + category +
|
||||
userID, 1);
|
||||
};
|
||||
@@ -19,6 +19,11 @@ if (config.mode === "test") {
|
||||
|
||||
// YouTubeAPI.videos.list wrapper with cacheing
|
||||
exportObject.listVideos = (videoID, part, callback) => {
|
||||
if (videoID.length !== 11 || videoID.includes(".")) {
|
||||
callback("Invalid video ID");
|
||||
return;
|
||||
}
|
||||
|
||||
let redisKey = "youtube.video." + videoID + "." + part;
|
||||
redis.get(redisKey, (getErr, result) => {
|
||||
if (getErr || !result) {
|
||||
|
||||
Reference in New Issue
Block a user