diff options
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/job-queue/handlers/video-channel-import.ts | 4 | ||||
-rw-r--r-- | server/lib/sync-channel.ts | 5 | ||||
-rw-r--r-- | server/lib/video-import.ts | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/server/lib/job-queue/handlers/video-channel-import.ts b/server/lib/job-queue/handlers/video-channel-import.ts index 9aaad659e..600292844 100644 --- a/server/lib/job-queue/handlers/video-channel-import.ts +++ b/server/lib/job-queue/handlers/video-channel-import.ts | |||
@@ -5,7 +5,7 @@ import { synchronizeChannel } from '@server/lib/sync-channel' | |||
5 | import { VideoChannelModel } from '@server/models/video/video-channel' | 5 | import { VideoChannelModel } from '@server/models/video/video-channel' |
6 | import { VideoChannelSyncModel } from '@server/models/video/video-channel-sync' | 6 | import { VideoChannelSyncModel } from '@server/models/video/video-channel-sync' |
7 | import { MChannelSync } from '@server/types/models' | 7 | import { MChannelSync } from '@server/types/models' |
8 | import { VideoChannelImportPayload } from '@shared/models' | 8 | import { VideoChannelImportPayload, VideoChannelSyncState } from '@shared/models' |
9 | 9 | ||
10 | export async function processVideoChannelImport (job: Job) { | 10 | export async function processVideoChannelImport (job: Job) { |
11 | const payload = job.data as VideoChannelImportPayload | 11 | const payload = job.data as VideoChannelImportPayload |
@@ -42,5 +42,7 @@ export async function processVideoChannelImport (job: Job) { | |||
42 | }) | 42 | }) |
43 | } catch (err) { | 43 | } catch (err) { |
44 | logger.error(`Failed to import channel ${videoChannel.name}`, { err }) | 44 | logger.error(`Failed to import channel ${videoChannel.name}`, { err }) |
45 | channelSync.state = VideoChannelSyncState.FAILED | ||
46 | await channelSync.save() | ||
45 | } | 47 | } |
46 | } | 48 | } |
diff --git a/server/lib/sync-channel.ts b/server/lib/sync-channel.ts index 3a81daac0..6cd1fc26d 100644 --- a/server/lib/sync-channel.ts +++ b/server/lib/sync-channel.ts | |||
@@ -93,7 +93,10 @@ async function skipImport (channel: MChannel, targetUrl: string, onlyAfter?: Dat | |||
93 | 93 | ||
94 | const videoInfo = await youtubeDL.getInfoForDownload() | 94 | const videoInfo = await youtubeDL.getInfoForDownload() |
95 | 95 | ||
96 | if (videoInfo.originallyPublishedAt.getTime() < onlyAfter.getTime()) { | 96 | const onlyAfterWithoutTime = new Date(onlyAfter) |
97 | onlyAfterWithoutTime.setHours(0, 0, 0) | ||
98 | |||
99 | if (videoInfo.originallyPublishedAtWithoutTime.getTime() >= onlyAfterWithoutTime.getTime()) { | ||
97 | return true | 100 | return true |
98 | } | 101 | } |
99 | } | 102 | } |
diff --git a/server/lib/video-import.ts b/server/lib/video-import.ts index de95116aa..d9da09040 100644 --- a/server/lib/video-import.ts +++ b/server/lib/video-import.ts | |||
@@ -125,7 +125,7 @@ async function buildVideoFromImport ({ channelId, importData, importDataOverride | |||
125 | channelId, | 125 | channelId, |
126 | originallyPublishedAt: importDataOverride?.originallyPublishedAt | 126 | originallyPublishedAt: importDataOverride?.originallyPublishedAt |
127 | ? new Date(importDataOverride?.originallyPublishedAt) | 127 | ? new Date(importDataOverride?.originallyPublishedAt) |
128 | : importData.originallyPublishedAt | 128 | : importData.originallyPublishedAtWithoutTime |
129 | } | 129 | } |
130 | 130 | ||
131 | videoData = await Hooks.wrapObject( | 131 | videoData = await Hooks.wrapObject( |