diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/import.ts | 3 | ||||
-rw-r--r-- | server/controllers/api/videos/index.ts | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index f9a24a0c2..a4ec41d44 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -15,7 +15,6 @@ import { VideoImportModel } from '../../../models/video/video-import' | |||
15 | import { JobQueue } from '../../../lib/job-queue/job-queue' | 15 | import { JobQueue } from '../../../lib/job-queue/job-queue' |
16 | import { join } from 'path' | 16 | import { join } from 'path' |
17 | import { isArray } from '../../../helpers/custom-validators/misc' | 17 | import { isArray } from '../../../helpers/custom-validators/misc' |
18 | import { FilteredModelAttributes } from 'sequelize-typescript/lib/models/Model' | ||
19 | import { VideoChannelModel } from '../../../models/video/video-channel' | 18 | import { VideoChannelModel } from '../../../models/video/video-channel' |
20 | import * as Bluebird from 'bluebird' | 19 | import * as Bluebird from 'bluebird' |
21 | import * as parseTorrent from 'parse-torrent' | 20 | import * as parseTorrent from 'parse-torrent' |
@@ -228,7 +227,7 @@ function insertIntoDB (parameters: { | |||
228 | previewModel: ThumbnailModel, | 227 | previewModel: ThumbnailModel, |
229 | videoChannel: VideoChannelModel, | 228 | videoChannel: VideoChannelModel, |
230 | tags: string[], | 229 | tags: string[], |
231 | videoImportAttributes: FilteredModelAttributes<VideoImportModel> | 230 | videoImportAttributes: Partial<VideoImportModel> |
232 | }): Bluebird<VideoImportModel> { | 231 | }): Bluebird<VideoImportModel> { |
233 | let { video, thumbnailModel, previewModel, videoChannel, tags, videoImportAttributes } = parameters | 232 | let { video, thumbnailModel, previewModel, videoChannel, tags, videoImportAttributes } = parameters |
234 | 233 | ||
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 24721a17f..ad2fe958c 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -332,15 +332,15 @@ async function updateVideo (req: express.Request, res: express.Response) { | |||
332 | if (videoInfoToUpdate.downloadEnabled !== undefined) videoInstance.set('downloadEnabled', videoInfoToUpdate.downloadEnabled) | 332 | if (videoInfoToUpdate.downloadEnabled !== undefined) videoInstance.set('downloadEnabled', videoInfoToUpdate.downloadEnabled) |
333 | 333 | ||
334 | if (videoInfoToUpdate.originallyPublishedAt !== undefined && videoInfoToUpdate.originallyPublishedAt !== null) { | 334 | if (videoInfoToUpdate.originallyPublishedAt !== undefined && videoInfoToUpdate.originallyPublishedAt !== null) { |
335 | videoInstance.set('originallyPublishedAt', videoInfoToUpdate.originallyPublishedAt) | 335 | videoInstance.originallyPublishedAt = new Date(videoInfoToUpdate.originallyPublishedAt) |
336 | } | 336 | } |
337 | 337 | ||
338 | if (videoInfoToUpdate.privacy !== undefined) { | 338 | if (videoInfoToUpdate.privacy !== undefined) { |
339 | const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10) | 339 | const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10) |
340 | videoInstance.set('privacy', newPrivacy) | 340 | videoInstance.privacy = newPrivacy |
341 | 341 | ||
342 | if (wasPrivateVideo === true && newPrivacy !== VideoPrivacy.PRIVATE) { | 342 | if (wasPrivateVideo === true && newPrivacy !== VideoPrivacy.PRIVATE) { |
343 | videoInstance.set('publishedAt', new Date()) | 343 | videoInstance.publishedAt = new Date() |
344 | } | 344 | } |
345 | } | 345 | } |
346 | 346 | ||