]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/shared/video.model.ts
Add like/dislike system for videos
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / shared / video.model.ts
index 8e676708b2908373a10eb6536a11f8f42beff61d..3eef936eba59ac6f8f00e6c9e4907a3c15b855c8 100644 (file)
@@ -12,6 +12,8 @@ export class Video {
   tags: string[];
   thumbnailPath: string;
   views: number;
+  likes: number;
+  dislikes: number;
 
   private static createByString(author: string, podHost: string) {
     return author + '@' + podHost;
@@ -38,7 +40,9 @@ export class Video {
     podHost: string,
     tags: string[],
     thumbnailPath: string,
-    views: number
+    views: number,
+    likes: number,
+    dislikes: number,
   }) {
     this.author  = hash.author;
     this.createdAt = new Date(hash.createdAt);
@@ -52,6 +56,8 @@ export class Video {
     this.tags = hash.tags;
     this.thumbnailPath = hash.thumbnailPath;
     this.views = hash.views;
+    this.likes = hash.likes;
+    this.dislikes = hash.dislikes;
 
     this.by = Video.createByString(hash.author, hash.podHost);
   }