aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/files-cache/videos-preview-cache.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-24 09:28:06 +0200
committerChocobozzz <me@florianbigard.com>2019-04-24 16:26:21 +0200
commitdc8527376482293c87fc6f30027d626f58a1197b (patch)
tree688625c5ab1619c3235f808a22bed0501c670a62 /server/lib/files-cache/videos-preview-cache.ts
parent3acc50844047a37698f0618fa235c138e386a053 (diff)
downloadPeerTube-dc8527376482293c87fc6f30027d626f58a1197b.tar.gz
PeerTube-dc8527376482293c87fc6f30027d626f58a1197b.tar.zst
PeerTube-dc8527376482293c87fc6f30027d626f58a1197b.zip
Refactor video caption/preview caches
Diffstat (limited to 'server/lib/files-cache/videos-preview-cache.ts')
-rw-r--r--server/lib/files-cache/videos-preview-cache.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/files-cache/videos-preview-cache.ts b/server/lib/files-cache/videos-preview-cache.ts
index c117ae426..14be7f24a 100644
--- a/server/lib/files-cache/videos-preview-cache.ts
+++ b/server/lib/files-cache/videos-preview-cache.ts
@@ -3,6 +3,7 @@ import { FILES_CACHE, STATIC_PATHS } from '../../initializers/constants'
3import { VideoModel } from '../../models/video/video' 3import { VideoModel } from '../../models/video/video'
4import { AbstractVideoStaticFileCache } from './abstract-video-static-file-cache' 4import { AbstractVideoStaticFileCache } from './abstract-video-static-file-cache'
5import { CONFIG } from '../../initializers/config' 5import { CONFIG } from '../../initializers/config'
6import { fetchRemoteVideoStaticFile } from '../activitypub'
6 7
7class VideosPreviewCache extends AbstractVideoStaticFileCache <string> { 8class VideosPreviewCache extends AbstractVideoStaticFileCache <string> {
8 9
@@ -35,9 +36,9 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache <string> {
35 const remoteStaticPath = join(STATIC_PATHS.PREVIEWS, video.getPreview().filename) 36 const remoteStaticPath = join(STATIC_PATHS.PREVIEWS, video.getPreview().filename)
36 const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, video.getPreview().filename) 37 const destPath = join(FILES_CACHE.PREVIEWS.DIRECTORY, video.getPreview().filename)
37 38
38 const path = await this.saveRemoteVideoFileAndReturnPath(video, remoteStaticPath, destPath) 39 await fetchRemoteVideoStaticFile(video, remoteStaticPath, destPath)
39 40
40 return { isOwned: false, path } 41 return { isOwned: false, path: destPath }
41 } 42 }
42} 43}
43 44