From 7c07259ae5c7b636d52b8ec103a19d31c2f5b755 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 24 Jun 2022 14:47:32 +0200 Subject: Fix fetching unlisted video in client --- .../+video-edit/video-add-components/video-import-url.component.ts | 2 +- client/src/app/+videos/+video-edit/video-update.resolver.ts | 2 +- .../+video-watch/shared/action-buttons/video-rate.component.ts | 6 +++--- .../+video-watch/shared/comment/video-comment-add.component.ts | 4 ++-- .../+videos/+video-watch/shared/comment/video-comments.component.ts | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'client/src/app/+videos') diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts index 0c78669c1..4c74eda84 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts @@ -78,7 +78,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV .pipe( switchMap(res => { return this.videoCaptionService - .listCaptions(res.video.id) + .listCaptions(res.video.uuid) .pipe( map(result => ({ video: res.video, videoCaptions: result.data })) ) diff --git a/client/src/app/+videos/+video-edit/video-update.resolver.ts b/client/src/app/+videos/+video-edit/video-update.resolver.ts index db5017340..524ceae10 100644 --- a/client/src/app/+videos/+video-edit/video-update.resolver.ts +++ b/client/src/app/+videos/+video-edit/video-update.resolver.ts @@ -39,7 +39,7 @@ export class VideoUpdateResolver implements Resolve { listUserChannelsForSelect(this.authService), this.videoCaptionService - .listCaptions(video.id) + .listCaptions(video.uuid) .pipe( map(result => result.data) ), diff --git a/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts b/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts index 48d48f33f..0fef246b3 100644 --- a/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts +++ b/client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts @@ -89,7 +89,7 @@ export class VideoRateComponent implements OnInit, OnChanges, OnDestroy { // Unlogged users do not have ratings if (this.isUserLoggedIn === false) return - this.videoService.getUserVideoRating(this.video.id) + this.videoService.getUserVideoRating(this.video.uuid) .subscribe({ next: ratingObject => { if (!ratingObject) return @@ -103,13 +103,13 @@ export class VideoRateComponent implements OnInit, OnChanges, OnDestroy { } private setRating (nextRating: UserVideoRateType) { - const ratingMethods: { [id in UserVideoRateType]: (id: number) => Observable } = { + const ratingMethods: { [id in UserVideoRateType]: (id: string) => Observable } = { like: this.videoService.setVideoLike, dislike: this.videoService.setVideoDislike, none: this.videoService.unsetVideoLike } - ratingMethods[nextRating].call(this.videoService, this.video.id) + ratingMethods[nextRating].call(this.videoService, this.video.uuid) .subscribe({ next: () => { // Update the video like attribute diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts index 85da83a4c..b2aa4cb7b 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts @@ -176,12 +176,12 @@ export class VideoCommentAddComponent extends FormReactive implements OnChanges, private addCommentReply (commentCreate: VideoCommentCreate) { return this.videoCommentService - .addCommentReply(this.video.id, this.parentComment.id, commentCreate) + .addCommentReply(this.video.uuid, this.parentComment.id, commentCreate) } private addCommentThread (commentCreate: VideoCommentCreate) { return this.videoCommentService - .addCommentThread(this.video.id, commentCreate) + .addCommentThread(this.video.uuid, commentCreate) } private initTextValue () { diff --git a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts index 17e0af3bc..8e556c58f 100644 --- a/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts +++ b/client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts @@ -78,7 +78,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { this.threadLoading[commentId] = true const params = { - videoId: this.video.id, + videoId: this.video.uuid, threadId: commentId } @@ -110,7 +110,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { loadMoreThreads () { const params = { - videoId: this.video.id, + videoId: this.video.uuid, componentPagination: this.componentPagination, sort: this.sort } -- cgit v1.2.3