Include video file id in API
This commit is contained in:
parent
5a9a56b78f
commit
12d84abeca
4 changed files with 7 additions and 0 deletions
|
@ -256,6 +256,8 @@ function videoFilesModelToFormattedJSON (
|
||||||
.sort(sortByResolutionDesc)
|
.sort(sortByResolutionDesc)
|
||||||
.map(videoFile => {
|
.map(videoFile => {
|
||||||
return {
|
return {
|
||||||
|
id: videoFile.id,
|
||||||
|
|
||||||
resolution: {
|
resolution: {
|
||||||
id: videoFile.resolution,
|
id: videoFile.resolution,
|
||||||
label: videoFile.resolution === 0 ? 'Audio' : `${videoFile.resolution}p`
|
label: videoFile.resolution === 0 ? 'Audio' : `${videoFile.resolution}p`
|
||||||
|
|
|
@ -115,6 +115,7 @@ async function completeVideoCheck (
|
||||||
// Transcoding enabled: extension will always be .mp4
|
// Transcoding enabled: extension will always be .mp4
|
||||||
if (attributes.files.length > 1) extension = '.mp4'
|
if (attributes.files.length > 1) extension = '.mp4'
|
||||||
|
|
||||||
|
expect(file.id).to.exist
|
||||||
expect(file.magnetUri).to.have.lengthOf.above(2)
|
expect(file.magnetUri).to.have.lengthOf.above(2)
|
||||||
|
|
||||||
expect(file.torrentDownloadUrl).to.match(new RegExp(`http://${host}/download/torrents/${uuidRegex}-${file.resolution.id}.torrent`))
|
expect(file.torrentDownloadUrl).to.match(new RegExp(`http://${host}/download/torrents/${uuidRegex}-${file.resolution.id}.torrent`))
|
||||||
|
|
|
@ -3,6 +3,8 @@ import { VideoFileMetadata } from './video-file-metadata.model'
|
||||||
import { VideoResolution } from './video-resolution.enum'
|
import { VideoResolution } from './video-resolution.enum'
|
||||||
|
|
||||||
export interface VideoFile {
|
export interface VideoFile {
|
||||||
|
id: number
|
||||||
|
|
||||||
resolution: VideoConstant<VideoResolution>
|
resolution: VideoConstant<VideoResolution>
|
||||||
size: number // Bytes
|
size: number // Bytes
|
||||||
|
|
||||||
|
|
|
@ -5665,6 +5665,8 @@ components:
|
||||||
VideoFile:
|
VideoFile:
|
||||||
readOnly: true
|
readOnly: true
|
||||||
properties:
|
properties:
|
||||||
|
id:
|
||||||
|
$ref: '#/components/schemas/id'
|
||||||
magnetUri:
|
magnetUri:
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: uri
|
||||||
|
|
Loading…
Add table
Reference in a new issue