]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/cache/videos-preview-cache.ts
Rename Pod -> Server
[github/Chocobozzz/PeerTube.git] / server / lib / cache / videos-preview-cache.ts
index 0fe4d2f7865202f19255b598c49514635dbec6c3..0570f51e8ec624f821f2a7db000a859e9e14c222 100644 (file)
@@ -3,9 +3,8 @@ import { join } from 'path'
 import { createWriteStream } from 'fs'
 
 import { database as db, CONFIG, CACHE } from '../../initializers'
-import { logger, unlinkPromise } from '../../helpers'
+import { logger, unlinkPromise, fetchRemoteVideoPreview } from '../../helpers'
 import { VideoInstance } from '../../models'
-import { fetchRemotePreview } from '../../lib'
 
 class VideosPreviewCache {
 
@@ -43,7 +42,7 @@ class VideosPreviewCache {
   }
 
   private async loadPreviews (key: string) {
-    const video = await db.Video.loadByUUIDAndPopulateAuthorAndPodAndTags(key)
+    const video = await db.Video.loadByUUIDAndPopulateAccountAndServerAndTags(key)
     if (!video) return undefined
 
     if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName())
@@ -54,7 +53,7 @@ class VideosPreviewCache {
   }
 
   private saveRemotePreviewAndReturnPath (video: VideoInstance) {
-    const req = fetchRemotePreview(video)
+    const req = fetchRemoteVideoPreview(video)
 
     return new Promise<string>((res, rej) => {
       const path = join(CACHE.DIRECTORIES.PREVIEWS, video.getPreviewName())