diff options
author | Chocobozzz <me@florianbigard.com> | 2021-11-02 11:00:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-11-02 11:13:13 +0100 |
commit | 7e7d8e485356402e7652c61c9f004e850b0a1607 (patch) | |
tree | 71c498c886cfd4b623a3c208572dc656ed800443 /client/src/app/shared | |
parent | fd5fa94bbc808e3ebb7a2e6bca636f2607566b52 (diff) | |
download | PeerTube-7e7d8e485356402e7652c61c9f004e850b0a1607.tar.gz PeerTube-7e7d8e485356402e7652c61c9f004e850b0a1607.tar.zst PeerTube-7e7d8e485356402e7652c61c9f004e850b0a1607.zip |
Some fixes for admin videos list
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/shared-main/video/video.service.ts | 16 |
1 files changed, 8 insertions, 8 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 5db9a8704..819847ac6 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts | |||
@@ -48,7 +48,7 @@ export type CommonVideoParams = { | |||
48 | 48 | ||
49 | @Injectable() | 49 | @Injectable() |
50 | export class VideoService { | 50 | export class VideoService { |
51 | static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' | 51 | static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos' |
52 | static BASE_FEEDS_URL = environment.apiUrl + '/feeds/videos.' | 52 | static BASE_FEEDS_URL = environment.apiUrl + '/feeds/videos.' |
53 | static BASE_SUBSCRIPTION_FEEDS_URL = environment.apiUrl + '/feeds/subscriptions.' | 53 | static BASE_SUBSCRIPTION_FEEDS_URL = environment.apiUrl + '/feeds/subscriptions.' |
54 | 54 | ||
@@ -60,18 +60,18 @@ export class VideoService { | |||
60 | ) {} | 60 | ) {} |
61 | 61 | ||
62 | getVideoViewUrl (uuid: string) { | 62 | getVideoViewUrl (uuid: string) { |
63 | return VideoService.BASE_VIDEO_URL + uuid + '/views' | 63 | return VideoService.BASE_VIDEO_URL + '/' + uuid + '/views' |
64 | } | 64 | } |
65 | 65 | ||
66 | getUserWatchingVideoUrl (uuid: string) { | 66 | getUserWatchingVideoUrl (uuid: string) { |
67 | return VideoService.BASE_VIDEO_URL + uuid + '/watching' | 67 | return VideoService.BASE_VIDEO_URL + '/' + uuid + '/watching' |
68 | } | 68 | } |
69 | 69 | ||
70 | getVideo (options: { videoId: string }): Observable<VideoDetails> { | 70 | getVideo (options: { videoId: string }): Observable<VideoDetails> { |
71 | return this.serverService.getServerLocale() | 71 | return this.serverService.getServerLocale() |
72 | .pipe( | 72 | .pipe( |
73 | switchMap(translations => { | 73 | switchMap(translations => { |
74 | return this.authHttp.get<VideoDetailsServerModel>(VideoService.BASE_VIDEO_URL + options.videoId) | 74 | return this.authHttp.get<VideoDetailsServerModel>(VideoService.BASE_VIDEO_URL + '/' + options.videoId) |
75 | .pipe(map(videoHash => ({ videoHash, translations }))) | 75 | .pipe(map(videoHash => ({ videoHash, translations }))) |
76 | }), | 76 | }), |
77 | map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)), | 77 | map(({ videoHash, translations }) => new VideoDetails(videoHash, translations)), |
@@ -111,7 +111,7 @@ export class VideoService { | |||
111 | 111 | ||
112 | const data = objectToFormData(body) | 112 | const data = objectToFormData(body) |
113 | 113 | ||
114 | return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, data) | 114 | return this.authHttp.put(VideoService.BASE_VIDEO_URL + '/' + video.id, data) |
115 | .pipe( | 115 | .pipe( |
116 | map(this.restExtractor.extractDataBool), | 116 | map(this.restExtractor.extractDataBool), |
117 | catchError(err => this.restExtractor.handleError(err)) | 117 | catchError(err => this.restExtractor.handleError(err)) |
@@ -119,7 +119,7 @@ export class VideoService { | |||
119 | } | 119 | } |
120 | 120 | ||
121 | uploadVideo (video: FormData) { | 121 | uploadVideo (video: FormData) { |
122 | const req = new HttpRequest('POST', VideoService.BASE_VIDEO_URL + 'upload', video, { reportProgress: true }) | 122 | const req = new HttpRequest('POST', VideoService.BASE_VIDEO_URL + '/' + 'upload', video, { reportProgress: true }) |
123 | 123 | ||
124 | return this.authHttp | 124 | return this.authHttp |
125 | .request<{ video: { id: number, uuid: string } }>(req) | 125 | .request<{ video: { id: number, uuid: string } }>(req) |
@@ -321,7 +321,7 @@ export class VideoService { | |||
321 | 321 | ||
322 | return from(ids) | 322 | return from(ids) |
323 | .pipe( | 323 | .pipe( |
324 | concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + id)), | 324 | concatMap(id => this.authHttp.delete(VideoService.BASE_VIDEO_URL + '/' + id)), |
325 | toArray(), | 325 | toArray(), |
326 | catchError(err => this.restExtractor.handleError(err)) | 326 | catchError(err => this.restExtractor.handleError(err)) |
327 | ) | 327 | ) |
@@ -413,7 +413,7 @@ export class VideoService { | |||
413 | } | 413 | } |
414 | 414 | ||
415 | private setVideoRate (id: number, rateType: UserVideoRateType) { | 415 | private setVideoRate (id: number, rateType: UserVideoRateType) { |
416 | const url = VideoService.BASE_VIDEO_URL + id + '/rate' | 416 | const url = VideoService.BASE_VIDEO_URL + '/' + id + '/rate' |
417 | const body: UserVideoRateUpdate = { | 417 | const body: UserVideoRateUpdate = { |
418 | rating: rateType | 418 | rating: rateType |
419 | } | 419 | } |