aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/sync-channel.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-09-16 13:48:13 +0200
committerChocobozzz <me@florianbigard.com>2022-09-16 13:51:57 +0200
commit9a3a23a834679e072c15960903e05e667ef14481 (patch)
treeb34fc17797938aa465d7ffb026d8bb40ff1924d5 /server/lib/sync-channel.ts
parent3c4754a3a16939337bfeb90c375fbb9e0f7d91fb (diff)
downloadPeerTube-9a3a23a834679e072c15960903e05e667ef14481.tar.gz
PeerTube-9a3a23a834679e072c15960903e05e667ef14481.tar.zst
PeerTube-9a3a23a834679e072c15960903e05e667ef14481.zip
Fix onlyAfter comparison
Diffstat (limited to 'server/lib/sync-channel.ts')
-rw-r--r--server/lib/sync-channel.ts6
1 files 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: {
80 80
81async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Date) { 81async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Date) {
82 if (await VideoImportModel.urlAlreadyImported(channel.id, targetUrl)) { 82 if (await VideoImportModel.urlAlreadyImported(channel.id, targetUrl)) {
83 logger.debug('%s is already imported for channel %s, skipping video channel synchronization.', channel.name, targetUrl) 83 logger.debug('%s is already imported for channel %s, skipping video channel synchronization.', targetUrl, channel.name)
84 return true 84 return true
85 } 85 }
86 86
@@ -94,9 +94,9 @@ async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Dat
94 const videoInfo = await youtubeDL.getInfoForDownload() 94 const videoInfo = await youtubeDL.getInfoForDownload()
95 95
96 const onlyAfterWithoutTime = new Date(onlyAfter) 96 const onlyAfterWithoutTime = new Date(onlyAfter)
97 onlyAfterWithoutTime.setHours(0, 0, 0) 97 onlyAfterWithoutTime.setHours(0, 0, 0, 0)
98 98
99 if (videoInfo.originallyPublishedAtWithoutTime.getTime() >= onlyAfterWithoutTime.getTime()) { 99 if (videoInfo.originallyPublishedAtWithoutTime.getTime() < onlyAfterWithoutTime.getTime()) {
100 return true 100 return true
101 } 101 }
102 } 102 }