]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/cache/videos-preview-cache.ts
Better view counter
[github/Chocobozzz/PeerTube.git] / server / lib / cache / videos-preview-cache.ts
index 776f647a048ba1e45ee7ec74edd8da8e9d74ed59..7f352f361df8e84905555eb22636212d216551b4 100644 (file)
@@ -3,8 +3,9 @@ import { join } from 'path'
 import { createWriteStream } from 'fs'
 
 import { database as db, CONFIG, CACHE } from '../../initializers'
-import { logger, unlinkPromise, fetchRemoteVideoPreview } from '../../helpers'
+import { logger, unlinkPromise } from '../../helpers'
 import { VideoInstance } from '../../models'
+import { fetchRemoteVideoPreview } from '../activitypub/videos'
 
 class VideosPreviewCache {
 
@@ -42,7 +43,7 @@ class VideosPreviewCache {
   }
 
   private async loadPreviews (key: string) {
-    const video = await db.Video.loadByUUIDAndPopulateAccountAndPodAndTags(key)
+    const video = await db.Video.loadByUUIDAndPopulateAccountAndServerAndTags(key)
     if (!video) return undefined
 
     if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName())