diff options
author | kontrollanten <6680299+kontrollanten@users.noreply.github.com> | 2022-06-21 15:31:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-21 15:31:25 +0200 |
commit | 2e401e8575decb1d491d0db48ca1ab1eba5b2a66 (patch) | |
tree | eee1e6213ca4d635837ca01c2bdc5c876b8d8b7d /client/src/app/shared | |
parent | dec49521556fc228c6e05b6199e9b07f619b38fb (diff) | |
download | PeerTube-2e401e8575decb1d491d0db48ca1ab1eba5b2a66.tar.gz PeerTube-2e401e8575decb1d491d0db48ca1ab1eba5b2a66.tar.zst PeerTube-2e401e8575decb1d491d0db48ca1ab1eba5b2a66.zip |
store uploaded video filename (#4885)
* store uploaded video filename
closes #4731
* dont crash if videos channel exist
* migration: use raw query
* video source: fixes after code review
* cleanup
* bump migration
* updates after code review
* refactor: use checkUserCanManageVideo
* videoSource: add openapi doc
* test(check-params/video-source): fix timeout
* Styling
* Correctly set original filename as source
Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/shared-main/video/video.service.ts | 17 |
1 files changed, 16 insertions, 1 deletions
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 142367506..83bc4eeb6 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { from, Observable } from 'rxjs' | 2 | import { from, Observable, of } from 'rxjs' |
3 | import { catchError, concatMap, map, switchMap, toArray } from 'rxjs/operators' | 3 | import { catchError, concatMap, map, switchMap, toArray } from 'rxjs/operators' |
4 | import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' | 4 | import { HttpClient, HttpParams, HttpRequest } from '@angular/common/http' |
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
@@ -24,6 +24,7 @@ import { | |||
24 | VideoTranscodingCreate, | 24 | VideoTranscodingCreate, |
25 | VideoUpdate | 25 | VideoUpdate |
26 | } from '@shared/models' | 26 | } from '@shared/models' |
27 | import { VideoSource } from '@shared/models/videos/video-source' | ||
27 | import { environment } from '../../../../environments/environment' | 28 | import { environment } from '../../../../environments/environment' |
28 | import { Account } from '../account/account.model' | 29 | import { Account } from '../account/account.model' |
29 | import { AccountService } from '../account/account.service' | 30 | import { AccountService } from '../account/account.service' |
@@ -323,6 +324,20 @@ export class VideoService { | |||
323 | ) | 324 | ) |
324 | } | 325 | } |
325 | 326 | ||
327 | getSource (videoId: number) { | ||
328 | return this.authHttp | ||
329 | .get<{ source: VideoSource }>(VideoService.BASE_VIDEO_URL + '/' + videoId + '/source') | ||
330 | .pipe( | ||
331 | catchError(err => { | ||
332 | if (err.status === 404) { | ||
333 | return of(undefined) | ||
334 | } | ||
335 | |||
336 | this.restExtractor.handleError(err) | ||
337 | }) | ||
338 | ) | ||
339 | } | ||
340 | |||
326 | setVideoLike (id: number) { | 341 | setVideoLike (id: number) { |
327 | return this.setVideoRate(id, 'like') | 342 | return this.setVideoRate(id, 'like') |
328 | } | 343 | } |