1
0
Fork 0

Include video file id in API

This commit is contained in:
Chocobozzz 2022-07-29 11:32:46 +02:00
parent 5a9a56b78f
commit 12d84abeca
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 7 additions and 0 deletions

View file

@ -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`

View file

@ -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`))

View file

@ -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

View file

@ -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