diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-20 16:24:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 16:24:31 +0200 |
commit | 0491173a61aed66205c017e0d7e0503ea316c144 (patch) | |
tree | ce6621597505f9518cfdf0981977d097c63f9fad /server/lib/cache | |
parent | 8704acf49efc770d73bf07c10468ed8c74d28a83 (diff) | |
parent | 6247b2057b792cea155a1abd9788c363ae7d2cc2 (diff) | |
download | PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.gz PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.zst PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.zip |
Merge branch 'develop' into cli-wrapper
Diffstat (limited to 'server/lib/cache')
-rw-r--r-- | server/lib/cache/videos-caption-cache.ts | 2 | ||||
-rw-r--r-- | server/lib/cache/videos-preview-cache.ts | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/cache/videos-caption-cache.ts b/server/lib/cache/videos-caption-cache.ts index 380d42b2c..f240affbc 100644 --- a/server/lib/cache/videos-caption-cache.ts +++ b/server/lib/cache/videos-caption-cache.ts | |||
@@ -38,7 +38,7 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache <GetPathParam> { | |||
38 | if (videoCaption.isOwned()) throw new Error('Cannot load remote caption of owned video.') | 38 | if (videoCaption.isOwned()) throw new Error('Cannot load remote caption of owned video.') |
39 | 39 | ||
40 | // Used to fetch the path | 40 | // Used to fetch the path |
41 | const video = await VideoModel.loadByUUIDAndPopulateAccountAndServerAndTags(videoId) | 41 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId) |
42 | if (!video) return undefined | 42 | if (!video) return undefined |
43 | 43 | ||
44 | const remoteStaticPath = videoCaption.getCaptionStaticPath() | 44 | const remoteStaticPath = videoCaption.getCaptionStaticPath() |
diff --git a/server/lib/cache/videos-preview-cache.ts b/server/lib/cache/videos-preview-cache.ts index 22b6d9cb0..a5d6f5b62 100644 --- a/server/lib/cache/videos-preview-cache.ts +++ b/server/lib/cache/videos-preview-cache.ts | |||
@@ -16,7 +16,7 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache <string> { | |||
16 | } | 16 | } |
17 | 17 | ||
18 | async getFilePath (videoUUID: string) { | 18 | async getFilePath (videoUUID: string) { |
19 | const video = await VideoModel.loadByUUID(videoUUID) | 19 | const video = await VideoModel.loadByUUIDWithFile(videoUUID) |
20 | if (!video) return undefined | 20 | if (!video) return undefined |
21 | 21 | ||
22 | if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName()) | 22 | if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName()) |
@@ -25,7 +25,7 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache <string> { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | protected async loadRemoteFile (key: string) { | 27 | protected async loadRemoteFile (key: string) { |
28 | const video = await VideoModel.loadByUUIDAndPopulateAccountAndServerAndTags(key) | 28 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(key) |
29 | if (!video) return undefined | 29 | if (!video) return undefined |
30 | 30 | ||
31 | if (video.isOwned()) throw new Error('Cannot load remote preview of owned video.') | 31 | if (video.isOwned()) throw new Error('Cannot load remote preview of owned video.') |