]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/video.service.ts
Add ability to set video thumbnail/preview
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video.service.ts
index fc7505a51fdedca0370882d7acb70e8750336fb1..d4f5e258f155ff2ae3b697bf21d617e6e9ecbc6c 100644 (file)
@@ -42,10 +42,10 @@ export class VideoService {
   }
 
   updateVideo (video: VideoEdit) {
-    const language = video.language || undefined
-    const licence = video.licence || undefined
-    const category = video.category || undefined
-    const description = video.description || undefined
+    const language = video.language || null
+    const licence = video.licence || null
+    const category = video.category || null
+    const description = video.description || null
 
     const body: VideoUpdate = {
       name: video.name,
@@ -55,7 +55,8 @@ export class VideoService {
       description,
       privacy: video.privacy,
       tags: video.tags,
-      nsfw: video.nsfw
+      nsfw: video.nsfw,
+      commentsEnabled: video.commentsEnabled
     }
 
     return this.authHttp.put(VideoService.BASE_VIDEO_URL + video.id, body)
@@ -135,6 +136,10 @@ export class VideoService {
     return this.setVideoRate(id, 'dislike')
   }
 
+  unsetVideoLike (id: number) {
+    return this.setVideoRate(id, 'none')
+  }
+
   getUserVideoRating (id: number): Observable<UserVideoRate> {
     const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating'