From 9a3a23a834679e072c15960903e05e667ef14481 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 16 Sep 2022 13:48:13 +0200 Subject: [PATCH] Fix onlyAfter comparison --- server/lib/sync-channel.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/lib/sync-channel.ts b/server/lib/sync-channel.ts index 6cd1fc26d..f91599c14 100644 --- a/server/lib/sync-channel.ts +++ b/server/lib/sync-channel.ts @@ -80,7 +80,7 @@ export async function synchronizeChannel (options: { async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Date) { if (await VideoImportModel.urlAlreadyImported(channel.id, targetUrl)) { - logger.debug('%s is already imported for channel %s, skipping video channel synchronization.', channel.name, targetUrl) + logger.debug('%s is already imported for channel %s, skipping video channel synchronization.', targetUrl, channel.name) return true } @@ -94,9 +94,9 @@ async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Dat const videoInfo = await youtubeDL.getInfoForDownload() const onlyAfterWithoutTime = new Date(onlyAfter) - onlyAfterWithoutTime.setHours(0, 0, 0) + onlyAfterWithoutTime.setHours(0, 0, 0, 0) - if (videoInfo.originallyPublishedAtWithoutTime.getTime() >= onlyAfterWithoutTime.getTime()) { + if (videoInfo.originallyPublishedAtWithoutTime.getTime() < onlyAfterWithoutTime.getTime()) { return true } } -- 2.41.0