]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/shared/video.model.ts
Client: add support for video licences
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / shared / video.model.ts
index fae001d78fa633ee6ca76a67fa47d9b194e3b5f8..5ed622dce63757067c7d8c2c39ba40b675db32b2 100644 (file)
@@ -2,6 +2,8 @@ export class Video {
   author: string;
   by: string;
   createdAt: Date;
+  categoryLabel: string;
+  licenceLabel: string;
   description: string;
   duration: string;
   id: string;
@@ -11,6 +13,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;
@@ -28,6 +33,8 @@ export class Video {
   constructor(hash: {
     author: string,
     createdAt: string,
+    categoryLabel: string,
+    licenceLabel: string,
     description: string,
     duration: number;
     id: string,
@@ -36,10 +43,15 @@ 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);
+    this.categoryLabel = hash.categoryLabel;
+    this.licenceLabel = hash.licenceLabel;
     this.description = hash.description;
     this.duration = Video.createDurationString(hash.duration);
     this.id = hash.id;
@@ -49,6 +61,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);
   }