X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-format-utils.ts;h=bcba90093d39a50fe89ebab0d2645ac2eaa2075e;hb=9a320a06b663a2e02c3156a07135f75f9e987b11;hp=455597d22e1ffad314802047ce42805d5817f80e;hpb=f66db4d5c851fe87bb71cccee96926000f59a15b;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 455597d22..bcba90093 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts @@ -14,11 +14,11 @@ import { } from '../../lib/activitypub/url' import { MStreamingPlaylistRedundanciesOpt, + MVideo, MVideoAP, MVideoFile, MVideoFormattable, - MVideoFormattableDetails, - MVideoWithHost + MVideoFormattableDetails } from '../../types/models' import { MVideoFileRedundanciesOpt } from '../../types/models/video/video-file' import { VideoModel } from './video' @@ -205,7 +205,7 @@ function videoFilesModelToFormattedJSON ( label: videoFile.resolution + 'p' }, - magnetUri: includeMagnet + magnetUri: includeMagnet && videoFile.torrentFilename ? generateMagnetUri(video, videoFile, trackerUrls) : undefined, @@ -225,7 +225,7 @@ function videoFilesModelToFormattedJSON ( function addVideoFilesInAPAcc ( acc: ActivityUrlObject[] | ActivityTagObject[], - video: MVideoWithHost, + video: MVideo, files: MVideoFile[] ) { const trackerUrls = video.getTrackerUrls()