X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Factivitypub%2Fcache-file.ts;h=2e6dd34e0365aad0f3920c61d38187d0b0c026b1;hb=fae6e4da8f516a9d6c3bad9bf6f35811ccacbad8;hp=65b2dcb494d337317fb380276c0cb49eaac4c809;hpb=8d5e65349deebd499c0be10fe02d535a77d58ddb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/activitypub/cache-file.ts b/server/lib/activitypub/cache-file.ts index 65b2dcb49..2e6dd34e0 100644 --- a/server/lib/activitypub/cache-file.ts +++ b/server/lib/activitypub/cache-file.ts @@ -2,7 +2,7 @@ import { CacheFileObject } from '../../../shared/index' 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) { @@ -13,7 +13,7 @@ function cacheFileActivityObjectToDBAttributes (cacheFileObject: CacheFileObject 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, @@ -30,7 +30,7 @@ function cacheFileActivityObjectToDBAttributes (cacheFileObject: CacheFileObject 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,