aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-17 16:04:53 +0100
committerChocobozzz <me@florianbigard.com>2021-11-18 09:04:30 +0100
commitb46cf4b920984492df598c1b61179acfc7f6f22e (patch)
tree21fda049c85be48ab3d37b537aafa98e94649ad7 /shared
parent3cfa817672657df18260ece5b354efa0f3b6e317 (diff)
downloadPeerTube-b46cf4b920984492df598c1b61179acfc7f6f22e.tar.gz
PeerTube-b46cf4b920984492df598c1b61179acfc7f6f22e.tar.zst
PeerTube-b46cf4b920984492df598c1b61179acfc7f6f22e.zip
Add ability to remove hls/webtorrent files
Diffstat (limited to 'shared')
-rw-r--r--shared/extra-utils/videos/videos-command.ts30
-rw-r--r--shared/models/users/user-right.enum.ts4
2 files changed, 33 insertions, 1 deletions
diff --git a/shared/extra-utils/videos/videos-command.ts b/shared/extra-utils/videos/videos-command.ts
index 167fae22d..13a7d0e1c 100644
--- a/shared/extra-utils/videos/videos-command.ts
+++ b/shared/extra-utils/videos/videos-command.ts
@@ -602,6 +602,36 @@ export class VideosCommand extends AbstractCommand {
602 602
603 // --------------------------------------------------------------------------- 603 // ---------------------------------------------------------------------------
604 604
605 removeHLSFiles (options: OverrideCommandOptions & {
606 videoId: number | string
607 }) {
608 const path = '/api/v1/videos/' + options.videoId + '/hls'
609
610 return this.deleteRequest({
611 ...options,
612
613 path,
614 implicitToken: true,
615 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
616 })
617 }
618
619 removeWebTorrentFiles (options: OverrideCommandOptions & {
620 videoId: number | string
621 }) {
622 const path = '/api/v1/videos/' + options.videoId + '/webtorrent'
623
624 return this.deleteRequest({
625 ...options,
626
627 path,
628 implicitToken: true,
629 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
630 })
631 }
632
633 // ---------------------------------------------------------------------------
634
605 private buildListQuery (options: VideosCommonQuery) { 635 private buildListQuery (options: VideosCommonQuery) {
606 return pick(options, [ 636 return pick(options, [
607 'start', 637 'start',
diff --git a/shared/models/users/user-right.enum.ts b/shared/models/users/user-right.enum.ts
index 950b22bad..96bccaf2f 100644
--- a/shared/models/users/user-right.enum.ts
+++ b/shared/models/users/user-right.enum.ts
@@ -38,5 +38,7 @@ export const enum UserRight {
38 38
39 MANAGE_PLUGINS, 39 MANAGE_PLUGINS,
40 40
41 MANAGE_VIDEOS_REDUNDANCIES 41 MANAGE_VIDEOS_REDUNDANCIES,
42
43 MANAGE_VIDEO_FILES
42} 44}