import { logger, loggerTagsFactory } from '@server/helpers/logger'
import { PeerTubeRequestError } from '@server/helpers/requests'
-import { VideoFetchByUrlType } from '@server/helpers/video'
import { ActorFollowScoreCache } from '@server/lib/files-cache'
+import { VideoLoadByUrlType } from '@server/lib/model-loaders'
import { VideoModel } from '@server/models/video/video'
import { MVideoAccountLightBlacklistAllFiles, MVideoThumbnail } from '@server/types/models'
import { HttpStatusCode } from '@shared/core-utils'
async function refreshVideoIfNeeded (options: {
video: MVideoThumbnail
- fetchedType: VideoFetchByUrlType
+ fetchedType: VideoLoadByUrlType
syncParam: SyncParam
}): Promise<MVideoThumbnail> {
if (!options.video.isOutdated()) return options.video
const lTags = loggerTagsFactory('ap', 'video', 'refresh', video.uuid, video.url)
+ logger.info('Refreshing video %s.', video.url, lTags())
+
try {
const { videoObject } = await fetchRemoteVideo(video.url)