import { database as db, CONFIG, CACHE } from '../../initializers'
import { logger, unlinkPromise } from '../../helpers'
import { VideoInstance } from '../../models'
-import { fetchRemotePreview } from '../../lib'
+import { fetchRemoteVideoPreview } from '../activitypub/videos'
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())
}
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())