]> 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 fae001d78fa633ee6ca76a67fa47d9b194e3b5f8..3eef936eba59ac6f8f00e6c9e4907a3c15b855c8 100644 (file)
@@ -11,6 +11,9 @@ export class Video {
   podHost: string;
   tags: string[];
   thumbnailPath: string;
+  views: number;
+  likes: number;
+  dislikes: number;
 
   private static createByString(author: string, podHost: string) {
     return author + '@' + podHost;
@@ -36,7 +39,10 @@ export class Video {
     name: string,
     podHost: string,
     tags: string[],
-    thumbnailPath: string
+    thumbnailPath: string,
+    views: number,
+    likes: number,
+    dislikes: number,
   }) {
     this.author  = hash.author;
     this.createdAt = new Date(hash.createdAt);
@@ -49,6 +55,9 @@ export class Video {
     this.podHost = hash.podHost;
     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);
   }