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:
parent
12d84abeca
commit
1bb4c9ab2e
23 changed files with 678 additions and 209 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue