- removeVideo (id: number) {
- return this.authHttp
- .delete(VideoService.BASE_VIDEO_URL + id)
- .pipe(
- map(this.restExtractor.extractDataBool),
- catchError(err => this.restExtractor.handleError(err))
- )
+ removeVideo (idArg: number | number[]) {
+ const ids = arrayify(idArg)
+
+ return from(ids)
+ .pipe(
+ concatMap(id => this.authHttp.delete(`${VideoService.BASE_VIDEO_URL}/${id}`)),
+ toArray(),
+ catchError(err => this.restExtractor.handleError(err))
+ )
+ }
+
+ 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))
+ )
+ }
+
+ removeFile (videoId: number | string, fileId: number, type: 'hls' | 'webtorrent') {
+ return this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + videoId + '/' + type + '/' + fileId)
+ .pipe(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))
+ )