aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/video.model.ts
diff options
context:
space:
mode:
authorBenjamin Bouvier <public@benj.me>2018-01-07 14:48:10 +0100
committerChocobozzz <me@florianbigard.com>2018-01-07 14:48:10 +0100
commit57a49263e48739c31cd339730ac4cb24e3d5d723 (patch)
tree520de9caa84113e704b39ae3b6f068a4fca7a66d /client/src/app/shared/video/video.model.ts
parentcbca00dfc14fe47260e8d081f4ed0bec7c66fd09 (diff)
downloadPeerTube-57a49263e48739c31cd339730ac4cb24e3d5d723.tar.gz
PeerTube-57a49263e48739c31cd339730ac4cb24e3d5d723.tar.zst
PeerTube-57a49263e48739c31cd339730ac4cb24e3d5d723.zip
A few updates for the watch video view (#181)
* Fixes #156: Filter out the video being watched from the list of other videos of the same author; * Fixes #167: in the video view, hide the author's domain when it's from the current host; * Fixes #171: Allow undoing a like/dislike;
Diffstat (limited to 'client/src/app/shared/video/video.model.ts')
-rw-r--r--client/src/app/shared/video/video.model.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts
index 060bf933f..a4b90ad94 100644
--- a/client/src/app/shared/video/video.model.ts
+++ b/client/src/app/shared/video/video.model.ts
@@ -35,7 +35,10 @@ export class Video implements VideoServerModel {
35 nsfw: boolean 35 nsfw: boolean
36 account: Account 36 account: Account
37 37
38 private static createByString (account: string, serverHost: string) { 38 private static createByString (account: string, serverHost: string, apiURL: string) {
39 const thisHost = new URL(apiURL).host
40 if (serverHost.trim() === thisHost)
41 return account
39 return account + '@' + serverHost 42 return account + '@' + serverHost
40 } 43 }
41 44
@@ -78,7 +81,7 @@ export class Video implements VideoServerModel {
78 this.dislikes = hash.dislikes 81 this.dislikes = hash.dislikes
79 this.nsfw = hash.nsfw 82 this.nsfw = hash.nsfw
80 83
81 this.by = Video.createByString(hash.accountName, hash.serverHost) 84 this.by = Video.createByString(hash.accountName, hash.serverHost, absoluteAPIUrl)
82 } 85 }
83 86
84 isVideoNSFWForUser (user: User) { 87 isVideoNSFWForUser (user: User) {