Verified Commit 12d84abe authored by Chocobozzz's avatar Chocobozzz
Browse files

Include video file id in API

parent 5a9a56b7
......@@ -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`
......
......@@ -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`))
......
......@@ -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
......
......@@ -5665,6 +5665,8 @@ components:
VideoFile:
readOnly: true
properties:
id:
$ref: '#/components/schemas/id'
magnetUri:
type: string
format: uri
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment