diff options
Diffstat (limited to 'client/src/app/videos/shared')
-rw-r--r-- | client/src/app/videos/shared/video.model.ts | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/client/src/app/videos/shared/video.model.ts b/client/src/app/videos/shared/video.model.ts index 873c83ff1..b51a0e9de 100644 --- a/client/src/app/videos/shared/video.model.ts +++ b/client/src/app/videos/shared/video.model.ts | |||
@@ -8,21 +8,12 @@ export class Video { | |||
8 | isLocal: boolean; | 8 | isLocal: boolean; |
9 | magnetUri: string; | 9 | magnetUri: string; |
10 | name: string; | 10 | name: string; |
11 | podUrl: string; | 11 | podHost: string; |
12 | tags: string[]; | 12 | tags: string[]; |
13 | thumbnailPath: string; | 13 | thumbnailPath: string; |
14 | 14 | ||
15 | private static createByString(author: string, podUrl: string) { | 15 | private static createByString(author: string, podHost: string) { |
16 | let [ host, port ] = podUrl.replace(/^https?:\/\//, '').split(':'); | 16 | return author + '@' + podHost; |
17 | |||
18 | if (port === '80' || port === '443') { | ||
19 | port = ''; | ||
20 | } else { | ||
21 | port = ':' + port; | ||
22 | } | ||
23 | |||
24 | |||
25 | return author + '@' + host + port; | ||
26 | } | 17 | } |
27 | 18 | ||
28 | private static createDurationString(duration: number) { | 19 | private static createDurationString(duration: number) { |
@@ -43,7 +34,7 @@ export class Video { | |||
43 | isLocal: boolean, | 34 | isLocal: boolean, |
44 | magnetUri: string, | 35 | magnetUri: string, |
45 | name: string, | 36 | name: string, |
46 | podUrl: string, | 37 | podHost: string, |
47 | tags: string[], | 38 | tags: string[], |
48 | thumbnailPath: string | 39 | thumbnailPath: string |
49 | }) { | 40 | }) { |
@@ -55,11 +46,11 @@ export class Video { | |||
55 | this.isLocal = hash.isLocal; | 46 | this.isLocal = hash.isLocal; |
56 | this.magnetUri = hash.magnetUri; | 47 | this.magnetUri = hash.magnetUri; |
57 | this.name = hash.name; | 48 | this.name = hash.name; |
58 | this.podUrl = hash.podUrl; | 49 | this.podHost = hash.podHost; |
59 | this.tags = hash.tags; | 50 | this.tags = hash.tags; |
60 | this.thumbnailPath = hash.thumbnailPath; | 51 | this.thumbnailPath = hash.thumbnailPath; |
61 | 52 | ||
62 | this.by = Video.createByString(hash.author, hash.podUrl); | 53 | this.by = Video.createByString(hash.author, hash.podHost); |
63 | } | 54 | } |
64 | 55 | ||
65 | isRemovableBy(user) { | 56 | isRemovableBy(user) { |