1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Add ability to delete a specific video file

This commit is contained in:
Chocobozzz 2022-07-29 14:50:41 +02:00
parent 12d84abeca
commit 1bb4c9ab2e
No known key found for this signature in database
GPG key ID: 583A612D890159BE
23 changed files with 678 additions and 209 deletions

View file

@ -20,10 +20,10 @@ import {
VideosCommonQuery,
VideoTranscodingCreate
} from '@shared/models'
import { VideoSource } from '@shared/models/videos/video-source'
import { unwrapBody } from '../requests'
import { waitJobs } from '../server'
import { AbstractCommand, OverrideCommandOptions } from '../shared'
import { VideoSource } from '@shared/models/videos/video-source'
export type VideoEdit = Partial<Omit<VideoCreate, 'thumbnailfile' | 'previewfile'>> & {
fixture?: string
@ -605,7 +605,7 @@ export class VideosCommand extends AbstractCommand {
// ---------------------------------------------------------------------------
removeHLSFiles (options: OverrideCommandOptions & {
removeHLSPlaylist (options: OverrideCommandOptions & {
videoId: number | string
}) {
const path = '/api/v1/videos/' + options.videoId + '/hls'
@ -619,7 +619,22 @@ export class VideosCommand extends AbstractCommand {
})
}
removeWebTorrentFiles (options: OverrideCommandOptions & {
removeHLSFile (options: OverrideCommandOptions & {
videoId: number | string
fileId: number
}) {
const path = '/api/v1/videos/' + options.videoId + '/hls/' + options.fileId
return this.deleteRequest({
...options,
path,
implicitToken: true,
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
})
}
removeAllWebTorrentFiles (options: OverrideCommandOptions & {
videoId: number | string
}) {
const path = '/api/v1/videos/' + options.videoId + '/webtorrent'
@ -633,6 +648,21 @@ export class VideosCommand extends AbstractCommand {
})
}
removeWebTorrentFile (options: OverrideCommandOptions & {
videoId: number | string
fileId: number
}) {
const path = '/api/v1/videos/' + options.videoId + '/webtorrent/' + options.fileId
return this.deleteRequest({
...options,
path,
implicitToken: true,
defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
})
}
runTranscoding (options: OverrideCommandOptions & {
videoId: number | string
transcodingType: 'hls' | 'webtorrent'