X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-main%2Fvideo%2Fvideo.service.ts;h=9bfa397f8979e0d547af7753ba275eac9fcdb4ca;hb=7137377d097a74087ed062c8071c1aa5c717c7f7;hp=570e8e3beca1747330cd3447f5dd5f84a4892306;hpb=527a52ac4295a072927ff46761766a8b181a7603;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index 570e8e3be..9bfa397f8 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts @@ -21,6 +21,7 @@ import { VideoInclude, VideoPrivacy, VideoSortField, + VideoTranscodingCreate, VideoUpdate } from '@shared/models' import { environment } from '../../../../environments/environment' @@ -299,6 +300,26 @@ export class VideoService { ) } + removeVideoFiles (videoIds: (number | string)[], type: 'hls' | 'webtorrent') { + return from(videoIds) + .pipe( + concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + id + '/' + type)), + toArray(), + catchError(err => this.restExtractor.handleError(err)) + ) + } + + runTranscoding (videoIds: (number | string)[], type: 'hls' | 'webtorrent') { + const body: VideoTranscodingCreate = { transcodingType: type } + + return from(videoIds) + .pipe( + concatMap(id => this.authHttp.post(VideoService.BASE_VIDEO_URL + '/' + id + '/transcoding', body)), + toArray(), + catchError(err => this.restExtractor.handleError(err)) + ) + } + loadCompleteDescription (descriptionPath: string) { return this.authHttp .get<{ description: string }>(environment.apiUrl + descriptionPath)