From 63ce5a54f24ec0d184f321e9f46dcda7c0d19325 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Feb 2018 11:03:42 +0100 Subject: [PATCH] Fix duplicates detection --- server/tools/import-youtube.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/tools/import-youtube.ts b/server/tools/import-youtube.ts index 82f48d8f7..68893306f 100644 --- a/server/tools/import-youtube.ts +++ b/server/tools/import-youtube.ts @@ -76,7 +76,7 @@ function processVideo (video: { name: string, url: string }, languageCode: numbe console.log('############################################################\n') - if (result.body.total !== 0) { + if (result.body.data.find(v => v.name === video.name)) { console.log('Video "%s" already exists, don\'t reupload it.\n', video.name) return res() } -- 2.25.1