aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-06-24 14:47:32 +0200
committerChocobozzz <me@florianbigard.com>2022-06-24 14:47:32 +0200
commit7c07259ae5c7b636d52b8ec103a19d31c2f5b755 (patch)
tree30e85294a11ce8356dbcc31b0f9df91a18086306 /client/src
parent978489b64c7b329cbfde5ffd7fe806702a3490c7 (diff)
downloadPeerTube-7c07259ae5c7b636d52b8ec103a19d31c2f5b755.tar.gz
PeerTube-7c07259ae5c7b636d52b8ec103a19d31c2f5b755.tar.zst
PeerTube-7c07259ae5c7b636d52b8ec103a19d31c2f5b755.zip
Fix fetching unlisted video in client
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-update.resolver.ts2
-rw-r--r--client/src/app/+videos/+video-watch/shared/action-buttons/video-rate.component.ts6
-rw-r--r--client/src/app/+videos/+video-watch/shared/comment/video-comment-add.component.ts4
-rw-r--r--client/src/app/+videos/+video-watch/shared/comment/video-comments.component.ts4
-rw-r--r--client/src/app/shared/shared-main/video-caption/video-caption.service.ts2
-rw-r--r--client/src/app/shared/shared-main/video/video.service.ts10
-rw-r--r--client/src/app/shared/shared-video-comment/video-comment.service.ts8
8 files changed, 19 insertions, 19 deletions
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
78 .pipe( 78 .pipe(
79 switchMap(res => { 79 switchMap(res => {
80 return this.videoCaptionService 80 return this.videoCaptionService
81 .listCaptions(res.video.id) 81 .listCaptions(res.video.uuid)
82 .pipe( 82 .pipe(
83 map(result => ({ video: res.video, videoCaptions: result.data })) 83 map(result => ({ video: res.video, videoCaptions: result.data }))
84 ) 84 )
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<any> {
39 listUserChannelsForSelect(this.authService), 39 listUserChannelsForSelect(this.authService),
40 40
41 this.videoCaptionService 41 this.videoCaptionService
42 .listCaptions(video.id) 42 .listCaptions(video.uuid)
43 .pipe( 43 .pipe(
44 map(result => result.data) 44 map(result => result.data)
45 ), 45 ),
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 {
89 // Unlogged users do not have ratings 89 // Unlogged users do not have ratings
90 if (this.isUserLoggedIn === false) return 90 if (this.isUserLoggedIn === false) return
91 91
92 this.videoService.getUserVideoRating(this.video.id) 92 this.videoService.getUserVideoRating(this.video.uuid)
93 .subscribe({ 93 .subscribe({
94 next: ratingObject => { 94 next: ratingObject => {
95 if (!ratingObject) return 95 if (!ratingObject) return
@@ -103,13 +103,13 @@ export class VideoRateComponent implements OnInit, OnChanges, OnDestroy {
103 } 103 }
104 104
105 private setRating (nextRating: UserVideoRateType) { 105 private setRating (nextRating: UserVideoRateType) {
106 const ratingMethods: { [id in UserVideoRateType]: (id: number) => Observable<any> } = { 106 const ratingMethods: { [id in UserVideoRateType]: (id: string) => Observable<any> } = {
107 like: this.videoService.setVideoLike, 107 like: this.videoService.setVideoLike,
108 dislike: this.videoService.setVideoDislike, 108 dislike: this.videoService.setVideoDislike,
109 none: this.videoService.unsetVideoLike 109 none: this.videoService.unsetVideoLike
110 } 110 }
111 111
112 ratingMethods[nextRating].call(this.videoService, this.video.id) 112 ratingMethods[nextRating].call(this.videoService, this.video.uuid)
113 .subscribe({ 113 .subscribe({
114 next: () => { 114 next: () => {
115 // Update the video like attribute 115 // 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,
176 176
177 private addCommentReply (commentCreate: VideoCommentCreate) { 177 private addCommentReply (commentCreate: VideoCommentCreate) {
178 return this.videoCommentService 178 return this.videoCommentService
179 .addCommentReply(this.video.id, this.parentComment.id, commentCreate) 179 .addCommentReply(this.video.uuid, this.parentComment.id, commentCreate)
180 } 180 }
181 181
182 private addCommentThread (commentCreate: VideoCommentCreate) { 182 private addCommentThread (commentCreate: VideoCommentCreate) {
183 return this.videoCommentService 183 return this.videoCommentService
184 .addCommentThread(this.video.id, commentCreate) 184 .addCommentThread(this.video.uuid, commentCreate)
185 } 185 }
186 186
187 private initTextValue () { 187 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 {
78 this.threadLoading[commentId] = true 78 this.threadLoading[commentId] = true
79 79
80 const params = { 80 const params = {
81 videoId: this.video.id, 81 videoId: this.video.uuid,
82 threadId: commentId 82 threadId: commentId
83 } 83 }
84 84
@@ -110,7 +110,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
110 110
111 loadMoreThreads () { 111 loadMoreThreads () {
112 const params = { 112 const params = {
113 videoId: this.video.id, 113 videoId: this.video.uuid,
114 componentPagination: this.componentPagination, 114 componentPagination: this.componentPagination,
115 sort: this.sort 115 sort: this.sort
116 } 116 }
diff --git a/client/src/app/shared/shared-main/video-caption/video-caption.service.ts b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts
index 00ebe5bc6..0f3afd116 100644
--- a/client/src/app/shared/shared-main/video-caption/video-caption.service.ts
+++ b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts
@@ -18,7 +18,7 @@ export class VideoCaptionService {
18 private restExtractor: RestExtractor 18 private restExtractor: RestExtractor
19 ) {} 19 ) {}
20 20
21 listCaptions (videoId: number | string): Observable<ResultList<VideoCaption>> { 21 listCaptions (videoId: string): Observable<ResultList<VideoCaption>> {
22 return this.authHttp.get<ResultList<VideoCaption>>(`${VideoService.BASE_VIDEO_URL}/${videoId}/captions`) 22 return this.authHttp.get<ResultList<VideoCaption>>(`${VideoService.BASE_VIDEO_URL}/${videoId}/captions`)
23 .pipe( 23 .pipe(
24 switchMap(captionsResult => { 24 switchMap(captionsResult => {
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 83bc4eeb6..7810c4303 100644
--- a/client/src/app/shared/shared-main/video/video.service.ts
+++ b/client/src/app/shared/shared-main/video/video.service.ts
@@ -338,19 +338,19 @@ export class VideoService {
338 ) 338 )
339 } 339 }
340 340
341 setVideoLike (id: number) { 341 setVideoLike (id: string) {
342 return this.setVideoRate(id, 'like') 342 return this.setVideoRate(id, 'like')
343 } 343 }
344 344
345 setVideoDislike (id: number) { 345 setVideoDislike (id: string) {
346 return this.setVideoRate(id, 'dislike') 346 return this.setVideoRate(id, 'dislike')
347 } 347 }
348 348
349 unsetVideoLike (id: number) { 349 unsetVideoLike (id: string) {
350 return this.setVideoRate(id, 'none') 350 return this.setVideoRate(id, 'none')
351 } 351 }
352 352
353 getUserVideoRating (id: number) { 353 getUserVideoRating (id: string) {
354 const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating' 354 const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating'
355 355
356 return this.authHttp.get<UserVideoRate>(url) 356 return this.authHttp.get<UserVideoRate>(url)
@@ -466,7 +466,7 @@ export class VideoService {
466 } 466 }
467 } 467 }
468 468
469 private setVideoRate (id: number, rateType: UserVideoRateType) { 469 private setVideoRate (id: string, rateType: UserVideoRateType) {
470 const url = `${VideoService.BASE_VIDEO_URL}/${id}/rate` 470 const url = `${VideoService.BASE_VIDEO_URL}/${id}/rate`
471 const body: UserVideoRateUpdate = { 471 const body: UserVideoRateUpdate = {
472 rating: rateType 472 rating: rateType
diff --git a/client/src/app/shared/shared-video-comment/video-comment.service.ts b/client/src/app/shared/shared-video-comment/video-comment.service.ts
index 6f2ef50cb..8cd94643a 100644
--- a/client/src/app/shared/shared-video-comment/video-comment.service.ts
+++ b/client/src/app/shared/shared-video-comment/video-comment.service.ts
@@ -31,7 +31,7 @@ export class VideoCommentService {
31 private restService: RestService 31 private restService: RestService
32 ) {} 32 ) {}
33 33
34 addCommentThread (videoId: number | string, comment: VideoCommentCreate) { 34 addCommentThread (videoId: string, comment: VideoCommentCreate) {
35 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads' 35 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads'
36 const normalizedComment = objectLineFeedToHtml(comment, 'text') 36 const normalizedComment = objectLineFeedToHtml(comment, 'text')
37 37
@@ -42,7 +42,7 @@ export class VideoCommentService {
42 ) 42 )
43 } 43 }
44 44
45 addCommentReply (videoId: number | string, inReplyToCommentId: number, comment: VideoCommentCreate) { 45 addCommentReply (videoId: string, inReplyToCommentId: number, comment: VideoCommentCreate) {
46 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comments/' + inReplyToCommentId 46 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comments/' + inReplyToCommentId
47 const normalizedComment = objectLineFeedToHtml(comment, 'text') 47 const normalizedComment = objectLineFeedToHtml(comment, 'text')
48 48
@@ -75,7 +75,7 @@ export class VideoCommentService {
75 } 75 }
76 76
77 getVideoCommentThreads (parameters: { 77 getVideoCommentThreads (parameters: {
78 videoId: number | string 78 videoId: string
79 componentPagination: ComponentPaginationLight 79 componentPagination: ComponentPaginationLight
80 sort: string 80 sort: string
81 }): Observable<ThreadsResultList<VideoComment>> { 81 }): Observable<ThreadsResultList<VideoComment>> {
@@ -95,7 +95,7 @@ export class VideoCommentService {
95 } 95 }
96 96
97 getVideoThreadComments (parameters: { 97 getVideoThreadComments (parameters: {
98 videoId: number | string 98 videoId: string
99 threadId: number 99 threadId: number
100 }): Observable<VideoCommentThreadTree> { 100 }): Observable<VideoCommentThreadTree> {
101 const { videoId, threadId } = parameters 101 const { videoId, threadId } = parameters