mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-25 02:00:35 -06:00
Include video file id in API
This commit is contained in:
parent
5a9a56b78f
commit
12d84abeca
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user