}
}
- protected includeWebtorrentFiles (required: boolean) {
- const joinType = required ? 'INNER' : 'LEFT'
- this.addJoin(joinType + ' JOIN "videoFile" AS "VideoFiles" ON "VideoFiles"."videoId" = "video"."id"')
+ protected includeWebtorrentFiles () {
+ this.addJoin('LEFT JOIN "videoFile" AS "VideoFiles" ON "VideoFiles"."videoId" = "video"."id"')
this.attributes = {
...this.attributes,
}
}
- protected includeStreamingPlaylistFiles (required: boolean) {
- const joinType = required ? 'INNER' : 'LEFT'
-
+ protected includeStreamingPlaylistFiles () {
this.addJoin(
- joinType + ' JOIN "videoStreamingPlaylist" AS "VideoStreamingPlaylists" ON "VideoStreamingPlaylists"."videoId" = "video"."id"'
+ 'LEFT JOIN "videoStreamingPlaylist" AS "VideoStreamingPlaylists" ON "VideoStreamingPlaylists"."videoId" = "video"."id"'
)
this.addJoin(
- joinType + ' JOIN "videoFile" AS "VideoStreamingPlaylists->VideoFiles" ' +
+ 'LEFT JOIN "videoFile" AS "VideoStreamingPlaylists->VideoFiles" ' +
'ON "VideoStreamingPlaylists->VideoFiles"."videoStreamingPlaylistId" = "VideoStreamingPlaylists"."id"'
)
'"video"."id"': ''
}
- this.includeWebtorrentFiles(true)
+ this.includeWebtorrentFiles()
if (this.shouldIncludeRedundancies(options)) {
this.includeWebTorrentRedundancies()
'"video"."id"': ''
}
- this.includeStreamingPlaylistFiles(true)
+ this.includeStreamingPlaylistFiles()
if (this.shouldIncludeRedundancies(options)) {
this.includeStreamingPlaylistRedundancies()
if (!rowsWebTorrentFiles) return
for (const row of rowsWebTorrentFiles) {
+ const id = row['VideoFiles.id']
+ if (!id) continue
+
const videoModel = this.videosMemo[row.id]
this.addWebTorrentFile(row, videoModel)
- this.addRedundancy(row, 'VideoFiles.RedundancyVideos', this.videoFileMemo[row['VideoFiles.id']])
+ this.addRedundancy(row, 'VideoFiles.RedundancyVideos', this.videoFileMemo[id])
}
}
if (!rowsStreamingPlaylist) return
for (const row of rowsStreamingPlaylist || []) {
+ const id = row['VideoStreamingPlaylists.id']
+ if (!id) continue
+
const videoModel = this.videosMemo[row.id]
this.addStreamingPlaylist(row, videoModel)
this.addRedundancy(
row,
'VideoStreamingPlaylists.RedundancyVideos',
- this.videoStreamingPlaylistMemo[row['VideoStreamingPlaylists.id']]
+ this.videoStreamingPlaylistMemo[id]
)
}
}
this.includeThumbnails()
if (options.withFiles) {
- this.includeWebtorrentFiles(false)
- this.includeStreamingPlaylistFiles(false)
+ this.includeWebtorrentFiles()
+ this.includeStreamingPlaylistFiles()
}
if (options.user) {
const expect = chai.expect
-describe('Permenant live', function () {
+describe('Permanent live', function () {
let servers: ServerInfo[] = []
let videoUUID: string