queryWebTorrentVideos (options: BuildVideoGetQueryOptions) {
this.buildWebtorrentFilesQuery(options)
- return this.runQuery(options.transaction)
+ return this.runQuery(options)
}
queryStreamingPlaylistVideos (options: BuildVideoGetQueryOptions) {
this.buildVideoStreamingPlaylistFilesQuery(options)
- return this.runQuery(options.transaction)
+ return this.runQuery(options)
}
private buildWebtorrentFilesQuery (options: BuildVideoGetQueryOptions) {
this.includeWebtorrentFiles(true)
- if (options.forGetAPI === true) {
+ if (this.shouldIncludeRedundancies(options)) {
this.includeWebTorrentRedundancies()
}
- this.whereId(options.id)
+ this.whereId(options)
this.query = this.buildQuery()
}
this.includeStreamingPlaylistFiles(true)
- if (options.forGetAPI === true) {
+ if (this.shouldIncludeRedundancies(options)) {
this.includeStreamingPlaylistRedundancies()
}
- this.whereId(options.id)
+ this.whereId(options)
this.query = this.buildQuery()
}
private buildQuery () {
return `${this.buildSelect()} FROM "video" ${this.joins} ${this.where}`
}
+
+ private shouldIncludeRedundancies (options: BuildVideoGetQueryOptions) {
+ return options.type === 'api'
+ }
}