import { VideoRedundancyModel } from '../../models/redundancy/video-redundancy'
import { Transaction } from 'sequelize'
import { VideoStreamingPlaylistType } from '../../../shared/models/videos/video-streaming-playlist.type'
-import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/typings/models'
+import { MActorId, MVideoRedundancy, MVideoWithAllFiles } from '@server/types/models'
function cacheFileActivityObjectToDBAttributes (cacheFileObject: CacheFileObject, video: MVideoWithAllFiles, byActor: MActorId) {
if (!playlist) throw new Error('Cannot find HLS playlist of video ' + video.url)
return {
- expiresOn: new Date(cacheFileObject.expires),
+ expiresOn: cacheFileObject.expires ? new Date(cacheFileObject.expires) : null,
url: cacheFileObject.id,
fileUrl: url.href,
strategy: null,
if (!videoFile) throw new Error(`Cannot find video file ${url.height} ${url.fps} of video ${video.url}`)
return {
- expiresOn: new Date(cacheFileObject.expires),
+ expiresOn: cacheFileObject.expires ? new Date(cacheFileObject.expires) : null,
url: cacheFileObject.id,
fileUrl: url.href,
strategy: null,