diff options
author | Chocobozzz <me@florianbigard.com> | 2023-06-19 09:56:12 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-06-29 10:19:54 +0200 |
commit | 53d4db2a8a11407165da6525cad3198439686d36 (patch) | |
tree | bcdacea812eb741eb25916a137d6f9d1bcc7704c /server/controllers/api | |
parent | 109d4a7f017e5ba18045f308158a71399a1b08cd (diff) | |
download | PeerTube-53d4db2a8a11407165da6525cad3198439686d36.tar.gz PeerTube-53d4db2a8a11407165da6525cad3198439686d36.tar.zst PeerTube-53d4db2a8a11407165da6525cad3198439686d36.zip |
Fix playlist thumbnail generation
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/video-playlist.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/server/controllers/api/video-playlist.ts b/server/controllers/api/video-playlist.ts index 1568ee597..304f1ddfb 100644 --- a/server/controllers/api/video-playlist.ts +++ b/server/controllers/api/video-playlist.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { join } from 'path' | ||
3 | import { scheduleRefreshIfNeeded } from '@server/lib/activitypub/playlists' | 2 | import { scheduleRefreshIfNeeded } from '@server/lib/activitypub/playlists' |
3 | import { VideoMiniaturePermanentFileCache } from '@server/lib/files-cache' | ||
4 | import { Hooks } from '@server/lib/plugins/hooks' | 4 | import { Hooks } from '@server/lib/plugins/hooks' |
5 | import { getServerActor } from '@server/models/application/application' | 5 | import { getServerActor } from '@server/models/application/application' |
6 | import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models' | 6 | import { MVideoPlaylistFull, MVideoPlaylistThumbnail, MVideoThumbnail } from '@server/types/models' |
@@ -18,7 +18,6 @@ import { resetSequelizeInstance } from '../../helpers/database-utils' | |||
18 | import { createReqFiles } from '../../helpers/express-utils' | 18 | import { createReqFiles } from '../../helpers/express-utils' |
19 | import { logger } from '../../helpers/logger' | 19 | import { logger } from '../../helpers/logger' |
20 | import { getFormattedObjects } from '../../helpers/utils' | 20 | import { getFormattedObjects } from '../../helpers/utils' |
21 | import { CONFIG } from '../../initializers/config' | ||
22 | import { MIMETYPES, VIDEO_PLAYLIST_PRIVACIES } from '../../initializers/constants' | 21 | import { MIMETYPES, VIDEO_PLAYLIST_PRIVACIES } from '../../initializers/constants' |
23 | import { sequelizeTypescript } from '../../initializers/database' | 22 | import { sequelizeTypescript } from '../../initializers/database' |
24 | import { sendCreateVideoPlaylist, sendDeleteVideoPlaylist, sendUpdateVideoPlaylist } from '../../lib/activitypub/send' | 23 | import { sendCreateVideoPlaylist, sendDeleteVideoPlaylist, sendUpdateVideoPlaylist } from '../../lib/activitypub/send' |
@@ -496,7 +495,10 @@ async function generateThumbnailForPlaylist (videoPlaylist: MVideoPlaylistThumbn | |||
496 | return | 495 | return |
497 | } | 496 | } |
498 | 497 | ||
499 | const inputPath = join(CONFIG.STORAGE.THUMBNAILS_DIR, videoMiniature.filename) | 498 | // Ensure the file is on disk |
499 | const videoMiniaturePermanentFileCache = new VideoMiniaturePermanentFileCache() | ||
500 | const inputPath = await videoMiniaturePermanentFileCache.downloadRemoteFile(videoMiniature) | ||
501 | |||
500 | const thumbnailModel = await updateLocalPlaylistMiniatureFromExisting({ | 502 | const thumbnailModel = await updateLocalPlaylistMiniatureFromExisting({ |
501 | inputPath, | 503 | inputPath, |
502 | playlist: videoPlaylist, | 504 | playlist: videoPlaylist, |