]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts
Fix fetching unlisted video in client
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / shared / action-buttons / video-rate.component.ts
index 48d48f33f41320f6b247a46b107b4be8f766b74d..0fef246b372f11fb5c9b4a2f653dd18b18d0d647 100644 (file)
@@ -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<any> } = {
+    const ratingMethods: { [id in UserVideoRateType]: (id: string) => Observable<any> } = {
       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