]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/sync-channel.ts
Fix error messages
[github/Chocobozzz/PeerTube.git] / server / lib / sync-channel.ts
index 3a81daac0dd88cc4137463bae3c69881a15da142..f91599c14dffdeba7c64880c7e5c30e561e9f0b0 100644 (file)
@@ -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
   }
 
@@ -93,7 +93,10 @@ async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Dat
 
     const videoInfo = await youtubeDL.getInfoForDownload()
 
-    if (videoInfo.originallyPublishedAt.getTime() < onlyAfter.getTime()) {
+    const onlyAfterWithoutTime = new Date(onlyAfter)
+    onlyAfterWithoutTime.setHours(0, 0, 0, 0)
+
+    if (videoInfo.originallyPublishedAtWithoutTime.getTime() < onlyAfterWithoutTime.getTime()) {
       return true
     }
   }