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 {
}
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())