Include video file id in API

pull/5170/head
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)
.map(videoFile => {
return {
id: videoFile.id,
resolution: {
id: videoFile.resolution,
label: videoFile.resolution === 0 ? 'Audio' : `${videoFile.resolution}p`

View File

@ -115,6 +115,7 @@ async function completeVideoCheck (
// Transcoding enabled: extension will always be .mp4
if (attributes.files.length > 1) extension = '.mp4'
expect(file.id).to.exist
expect(file.magnetUri).to.have.lengthOf.above(2)
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'
export interface VideoFile {
id: number
resolution: VideoConstant<VideoResolution>
size: number // Bytes

View File

@ -5665,6 +5665,8 @@ components:
VideoFile:
readOnly: true
properties:
id:
$ref: '#/components/schemas/id'
magnetUri:
type: string
format: uri