dumb issue
This commit is contained in:
parent
c5b3b589a9
commit
ffc74f3c1e
|
@ -145,21 +145,21 @@ app.ws('/savechannel', {
|
||||||
const videos = await getChannelVideos(channelId);
|
const videos = await getChannelVideos(channelId);
|
||||||
|
|
||||||
for (const video of videos.slice(0, 5)) {
|
for (const video of videos.slice(0, 5)) {
|
||||||
if (!video || (await redis.get(video.id)) || (await redis.get(`blacklist:${video.id}`))) continue;
|
if (!video || (await redis.get(video.video_id)) || (await redis.get(`blacklist:${video.video_id}`))) continue;
|
||||||
|
|
||||||
const already = await db.selectFrom('videos')
|
const already = await db.selectFrom('videos')
|
||||||
.select('id')
|
.select('id')
|
||||||
.where('id', '=', video.id)
|
.where('id', '=', video.video_id)
|
||||||
.executeTakeFirst()
|
.executeTakeFirst()
|
||||||
if (already) continue
|
if (already) continue
|
||||||
|
|
||||||
ws.send(`DATA - Processing video: ${video.title.text}`);
|
ws.send(`DATA - Processing video: ${video.title.text}`);
|
||||||
await redis.set(video.id, 'downloading', 'EX', 300);
|
await redis.set(video.video_id, 'downloading', 'EX', 300);
|
||||||
|
|
||||||
const downloadResult = await downloadVideo(ws, video.id);
|
const downloadResult = await downloadVideo(ws, video.video_id);
|
||||||
if (!downloadResult.fail) await handleUpload(ws, video.id, true);
|
if (!downloadResult.fail) await handleUpload(ws, video.video_id, true);
|
||||||
|
|
||||||
await redis.del(video.id);
|
await redis.del(video.video_id);
|
||||||
ws.send(`DATA - Created video page for ${video.title.text}`)
|
ws.send(`DATA - Created video page for ${video.title.text}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue