diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-24 09:56:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-24 16:26:22 +0200 |
commit | 2fb5b3a55aeebcc77f4b3a0c029bbf0738ef0063 (patch) | |
tree | 3f03677870548c648070ac138a2b5ca36ee8fbeb /server/lib | |
parent | b876eaf11a1ed9683664d94767ca684ba5b77753 (diff) | |
download | PeerTube-2fb5b3a55aeebcc77f4b3a0c029bbf0738ef0063.tar.gz PeerTube-2fb5b3a55aeebcc77f4b3a0c029bbf0738ef0063.tar.zst PeerTube-2fb5b3a55aeebcc77f4b3a0c029bbf0738ef0063.zip |
Relax videos list thumbnail api join
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/avatar.ts | 2 | ||||
-rw-r--r-- | server/lib/thumbnail.ts | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/avatar.ts b/server/lib/avatar.ts index dca543d0b..09b4e38ca 100644 --- a/server/lib/avatar.ts +++ b/server/lib/avatar.ts | |||
@@ -15,7 +15,7 @@ async function updateActorAvatarFile (avatarPhysicalFile: Express.Multer.File, a | |||
15 | const extension = extname(avatarPhysicalFile.filename) | 15 | const extension = extname(avatarPhysicalFile.filename) |
16 | const avatarName = uuidv4() + extension | 16 | const avatarName = uuidv4() + extension |
17 | const destination = join(CONFIG.STORAGE.AVATARS_DIR, avatarName) | 17 | const destination = join(CONFIG.STORAGE.AVATARS_DIR, avatarName) |
18 | await processImage(avatarPhysicalFile, destination, AVATARS_SIZE) | 18 | await processImage(avatarPhysicalFile.path, destination, AVATARS_SIZE) |
19 | 19 | ||
20 | return retryTransactionWrapper(() => { | 20 | return retryTransactionWrapper(() => { |
21 | return sequelizeTypescript.transaction(async t => { | 21 | return sequelizeTypescript.transaction(async t => { |
diff --git a/server/lib/thumbnail.ts b/server/lib/thumbnail.ts index 8ad82ee80..4ba521b97 100644 --- a/server/lib/thumbnail.ts +++ b/server/lib/thumbnail.ts | |||
@@ -16,7 +16,7 @@ function createPlaylistMiniatureFromExisting (inputPath: string, playlist: Video | |||
16 | const { filename, outputPath, height, width, existingThumbnail } = buildMetadataFromPlaylist(playlist, size) | 16 | const { filename, outputPath, height, width, existingThumbnail } = buildMetadataFromPlaylist(playlist, size) |
17 | const type = ThumbnailType.MINIATURE | 17 | const type = ThumbnailType.MINIATURE |
18 | 18 | ||
19 | const thumbnailCreator = () => processImage({ path: inputPath }, outputPath, { width, height }, keepOriginal) | 19 | const thumbnailCreator = () => processImage(inputPath, outputPath, { width, height }, keepOriginal) |
20 | return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail }) | 20 | return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail }) |
21 | } | 21 | } |
22 | 22 | ||
@@ -37,7 +37,7 @@ function createVideoMiniatureFromUrl (url: string, video: VideoModel, type: Thum | |||
37 | 37 | ||
38 | function createVideoMiniatureFromExisting (inputPath: string, video: VideoModel, type: ThumbnailType, size?: ImageSize) { | 38 | function createVideoMiniatureFromExisting (inputPath: string, video: VideoModel, type: ThumbnailType, size?: ImageSize) { |
39 | const { filename, outputPath, height, width, existingThumbnail } = buildMetadataFromVideo(video, type, size) | 39 | const { filename, outputPath, height, width, existingThumbnail } = buildMetadataFromVideo(video, type, size) |
40 | const thumbnailCreator = () => processImage({ path: inputPath }, outputPath, { width, height }) | 40 | const thumbnailCreator = () => processImage(inputPath, outputPath, { width, height }) |
41 | 41 | ||
42 | return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail }) | 42 | return createThumbnailFromFunction({ thumbnailCreator, filename, height, width, type, existingThumbnail }) |
43 | } | 43 | } |