diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-03-08 21:35:43 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-03-08 21:35:43 +0100 |
commit | d38b82810638b9f664c9016fac2684454c273a77 (patch) | |
tree | 9465c367e5033675309efca4d66790c6fdd5230d /client/src/app/videos/shared/video.model.ts | |
parent | 8f9064432122cba0f518a24ac4378357dadec589 (diff) | |
download | PeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.gz PeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.zst PeerTube-d38b82810638b9f664c9016fac2684454c273a77.zip |
Add like/dislike system for videos
Diffstat (limited to 'client/src/app/videos/shared/video.model.ts')
-rw-r--r-- | client/src/app/videos/shared/video.model.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/app/videos/shared/video.model.ts b/client/src/app/videos/shared/video.model.ts index 8e676708b..3eef936eb 100644 --- a/client/src/app/videos/shared/video.model.ts +++ b/client/src/app/videos/shared/video.model.ts | |||
@@ -12,6 +12,8 @@ export class Video { | |||
12 | tags: string[]; | 12 | tags: string[]; |
13 | thumbnailPath: string; | 13 | thumbnailPath: string; |
14 | views: number; | 14 | views: number; |
15 | likes: number; | ||
16 | dislikes: number; | ||
15 | 17 | ||
16 | private static createByString(author: string, podHost: string) { | 18 | private static createByString(author: string, podHost: string) { |
17 | return author + '@' + podHost; | 19 | return author + '@' + podHost; |
@@ -38,7 +40,9 @@ export class Video { | |||
38 | podHost: string, | 40 | podHost: string, |
39 | tags: string[], | 41 | tags: string[], |
40 | thumbnailPath: string, | 42 | thumbnailPath: string, |
41 | views: number | 43 | views: number, |
44 | likes: number, | ||
45 | dislikes: number, | ||
42 | }) { | 46 | }) { |
43 | this.author = hash.author; | 47 | this.author = hash.author; |
44 | this.createdAt = new Date(hash.createdAt); | 48 | this.createdAt = new Date(hash.createdAt); |
@@ -52,6 +56,8 @@ export class Video { | |||
52 | this.tags = hash.tags; | 56 | this.tags = hash.tags; |
53 | this.thumbnailPath = hash.thumbnailPath; | 57 | this.thumbnailPath = hash.thumbnailPath; |
54 | this.views = hash.views; | 58 | this.views = hash.views; |
59 | this.likes = hash.likes; | ||
60 | this.dislikes = hash.dislikes; | ||
55 | 61 | ||
56 | this.by = Video.createByString(hash.author, hash.podHost); | 62 | this.by = Video.createByString(hash.author, hash.podHost); |
57 | } | 63 | } |