* Adding video items to the feed object, one at a time
*/
for (const video of videos) {
- const formattedVideoFiles = video.getFormattedVideoFilesJSON()
+ const formattedVideoFiles = video.getFormattedVideoFilesJSON(false)
const torrents = formattedVideoFiles.map(videoFile => ({
title: video.name,
function videoFilesModelToFormattedJSON (
video: MVideoFormattableDetails,
- videoFiles: MVideoFileRedundanciesOpt[]
+ videoFiles: MVideoFileRedundanciesOpt[],
+ includeMagnet = true
): VideoFile[] {
- const trackerUrls = video.getTrackerUrls()
+ const trackerUrls = includeMagnet
+ ? video.getTrackerUrls()
+ : []
return [ ...videoFiles ]
.filter(f => !f.isLive())
label: videoFile.resolution + 'p'
},
- // FIXME: deprecated in 3.2
- magnetUri: generateMagnetUri(video, videoFile, trackerUrls),
+ magnetUri: includeMagnet
+ ? generateMagnetUri(video, videoFile, trackerUrls)
+ : undefined,
size: videoFile.size,
fps: videoFile.fps,
return videoModelToFormattedDetailsJSON(this)
}
- getFormattedVideoFilesJSON (): VideoFile[] {
+ getFormattedVideoFilesJSON (includeMagnet = true): VideoFile[] {
let files: VideoFile[] = []
if (Array.isArray(this.VideoFiles)) {
- const result = videoFilesModelToFormattedJSON(this, this.VideoFiles)
+ const result = videoFilesModelToFormattedJSON(this, this.VideoFiles, includeMagnet)
files = files.concat(result)
}
for (const p of (this.VideoStreamingPlaylists || [])) {
- const result = videoFilesModelToFormattedJSON(this, p.VideoFiles)
+ const result = videoFilesModelToFormattedJSON(this, p.VideoFiles, includeMagnet)
files = files.concat(result)
}
metadata?: VideoFileMetadata
metadataUrl?: string
- // FIXME: deprecated in 3.2
- magnetUri: string
+ magnetUri: string | null
}