mirror of https://github.com/Chocobozzz/PeerTube
Fix rss feed with HLS videos
parent
00b87c5791
commit
7a4994873c
|
@ -472,6 +472,8 @@ function wrapForAPIResults (baseQuery: string, replacements: any, options: Build
|
|||
'"VideoFiles"."videoId"': '"VideoFiles.videoId"',
|
||||
|
||||
'"VideoStreamingPlaylists"."id"': '"VideoStreamingPlaylists.id"',
|
||||
'"VideoStreamingPlaylists"."playlistUrl"': '"VideoStreamingPlaylists.playlistUrl"',
|
||||
'"VideoStreamingPlaylists"."type"': '"VideoStreamingPlaylists.type"',
|
||||
'"VideoStreamingPlaylists->VideoFiles"."id"': '"VideoStreamingPlaylists.VideoFiles.id"',
|
||||
'"VideoStreamingPlaylists->VideoFiles"."createdAt"': '"VideoStreamingPlaylists.VideoFiles.createdAt"',
|
||||
'"VideoStreamingPlaylists->VideoFiles"."updatedAt"': '"VideoStreamingPlaylists.VideoFiles.updatedAt"',
|
||||
|
@ -480,6 +482,7 @@ function wrapForAPIResults (baseQuery: string, replacements: any, options: Build
|
|||
'"VideoStreamingPlaylists->VideoFiles"."extname"': '"VideoStreamingPlaylists.VideoFiles.extname"',
|
||||
'"VideoStreamingPlaylists->VideoFiles"."infoHash"': '"VideoStreamingPlaylists.VideoFiles.infoHash"',
|
||||
'"VideoStreamingPlaylists->VideoFiles"."fps"': '"VideoStreamingPlaylists.VideoFiles.fps"',
|
||||
'"VideoStreamingPlaylists->VideoFiles"."videoStreamingPlaylistId"': '"VideoStreamingPlaylists.VideoFiles.videoStreamingPlaylistId"',
|
||||
'"VideoStreamingPlaylists->VideoFiles"."videoId"': '"VideoStreamingPlaylists.VideoFiles.videoId"'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -152,8 +152,6 @@ export type ForAPIOptions = {
|
|||
|
||||
videoPlaylistId?: number
|
||||
|
||||
withFiles?: boolean
|
||||
|
||||
withAccountBlockerIds?: number[]
|
||||
}
|
||||
|
||||
|
@ -220,13 +218,6 @@ export type AvailableForListIDsOptions = {
|
|||
}
|
||||
}
|
||||
|
||||
if (options.withFiles === true) {
|
||||
include.push({
|
||||
model: VideoFileModel,
|
||||
required: true
|
||||
})
|
||||
}
|
||||
|
||||
if (options.videoPlaylistId) {
|
||||
include.push({
|
||||
model: VideoPlaylistElementModel.unscoped(),
|
||||
|
@ -1622,8 +1613,19 @@ export class VideoModel extends Model {
|
|||
const avatarKeys = [ 'id', 'filename', 'fileUrl', 'onDisk', 'createdAt', 'updatedAt' ]
|
||||
const actorKeys = [ 'id', 'preferredUsername', 'url', 'serverId', 'avatarId' ]
|
||||
const serverKeys = [ 'id', 'host' ]
|
||||
const videoFileKeys = [ 'id', 'createdAt', 'updatedAt', 'resolution', 'size', 'extname', 'infoHash', 'fps', 'videoId' ]
|
||||
const videoStreamingPlaylistKeys = [ 'id' ]
|
||||
const videoFileKeys = [
|
||||
'id',
|
||||
'createdAt',
|
||||
'updatedAt',
|
||||
'resolution',
|
||||
'size',
|
||||
'extname',
|
||||
'infoHash',
|
||||
'fps',
|
||||
'videoId',
|
||||
'videoStreamingPlaylistId'
|
||||
]
|
||||
const videoStreamingPlaylistKeys = [ 'id', 'type', 'playlistUrl' ]
|
||||
const videoKeys = [
|
||||
'id',
|
||||
'uuid',
|
||||
|
@ -1882,17 +1884,21 @@ export class VideoModel extends Model {
|
|||
|
||||
getFormattedVideoFilesJSON (): VideoFile[] {
|
||||
const { baseUrlHttp, baseUrlWs } = this.getBaseUrls()
|
||||
let files: MVideoFileRedundanciesOpt[] = []
|
||||
let files: VideoFile[] = []
|
||||
|
||||
if (Array.isArray(this.VideoFiles)) {
|
||||
files = files.concat(this.VideoFiles)
|
||||
const result = videoFilesModelToFormattedJSON(this, baseUrlHttp, baseUrlWs, this.VideoFiles)
|
||||
files = files.concat(result)
|
||||
}
|
||||
|
||||
for (const p of (this.VideoStreamingPlaylists || [])) {
|
||||
files = files.concat(p.VideoFiles || [])
|
||||
p.Video = this
|
||||
|
||||
const result = videoFilesModelToFormattedJSON(p, baseUrlHttp, baseUrlWs, p.VideoFiles)
|
||||
files = files.concat(result)
|
||||
}
|
||||
|
||||
return videoFilesModelToFormattedJSON(this, baseUrlHttp, baseUrlWs, files)
|
||||
return files
|
||||
}
|
||||
|
||||
toActivityPubObject (this: MVideoAP): VideoObject {
|
||||
|
|
Loading…
Reference in New Issue