Fix onlyAfter comparison

pull/5271/head
Chocobozzz 2022-09-16 13:48:13 +02:00
parent 3c4754a3a1
commit 9a3a23a834
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 3 additions and 3 deletions

View File

@ -80,7 +80,7 @@ export async function synchronizeChannel (options: {
async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Date) { async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Date) {
if (await VideoImportModel.urlAlreadyImported(channel.id, targetUrl)) { 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 return true
} }
@ -94,9 +94,9 @@ async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Dat
const videoInfo = await youtubeDL.getInfoForDownload() const videoInfo = await youtubeDL.getInfoForDownload()
const onlyAfterWithoutTime = new Date(onlyAfter) 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 return true
} }
} }