diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-11 11:02:35 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-11 11:02:35 +0200 |
commit | 69f616ab3aeefd6ce330600604df90f2f48bfe3b (patch) | |
tree | 1b40d6005e645d97a7db9784f32cd90b156528fa /client | |
parent | 75fb0c0b2efe7fb952d45d2bf111e9594f7d5b42 (diff) | |
download | PeerTube-69f616ab3aeefd6ce330600604df90f2f48bfe3b.tar.gz PeerTube-69f616ab3aeefd6ce330600604df90f2f48bfe3b.tar.zst PeerTube-69f616ab3aeefd6ce330600604df90f2f48bfe3b.zip |
Use shared models
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/shared/users/user.model.ts | 7 | ||||
-rw-r--r-- | client/src/app/videos/shared/video.model.ts | 21 | ||||
-rw-r--r-- | client/src/app/videos/video-list/video-miniature.component.html | 2 |
3 files changed, 19 insertions, 11 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index f7859f495..09722704a 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts | |||
@@ -1,6 +1,9 @@ | |||
1 | export class User { | 1 | import { User as UserServerModel } from '../../../../../shared'; |
2 | |||
3 | export class User implements UserServerModel { | ||
2 | id: number; | 4 | id: number; |
3 | username: string; | 5 | username: string; |
6 | email: string; | ||
4 | role: string; | 7 | role: string; |
5 | displayNSFW: boolean; | 8 | displayNSFW: boolean; |
6 | createdAt: Date; | 9 | createdAt: Date; |
@@ -8,12 +11,14 @@ export class User { | |||
8 | constructor(hash: { | 11 | constructor(hash: { |
9 | id: number, | 12 | id: number, |
10 | username: string, | 13 | username: string, |
14 | email: string, | ||
11 | role: string, | 15 | role: string, |
12 | displayNSFW?: boolean, | 16 | displayNSFW?: boolean, |
13 | createdAt?: Date, | 17 | createdAt?: Date, |
14 | }) { | 18 | }) { |
15 | this.id = hash.id; | 19 | this.id = hash.id; |
16 | this.username = hash.username; | 20 | this.username = hash.username; |
21 | this.email = hash.email; | ||
17 | this.role = hash.role; | 22 | this.role = hash.role; |
18 | this.displayNSFW = hash.displayNSFW; | 23 | this.displayNSFW = hash.displayNSFW; |
19 | 24 | ||
diff --git a/client/src/app/videos/shared/video.model.ts b/client/src/app/videos/shared/video.model.ts index fafdb4ac4..0cf4039df 100644 --- a/client/src/app/videos/shared/video.model.ts +++ b/client/src/app/videos/shared/video.model.ts | |||
@@ -1,17 +1,19 @@ | |||
1 | import { Video as VideoServerModel } from '../../../../../shared'; | ||
1 | import { User } from '../../shared'; | 2 | import { User } from '../../shared'; |
2 | 3 | ||
3 | export class Video { | 4 | export class Video implements VideoServerModel { |
4 | author: string; | 5 | author: string; |
5 | by: string; | 6 | by: string; |
6 | createdAt: Date; | 7 | createdAt: Date; |
7 | categoryLabel: string; | 8 | categoryLabel: string; |
8 | category: string; | 9 | category: number; |
9 | licenceLabel: string; | 10 | licenceLabel: string; |
10 | licence: string; | 11 | licence: number; |
11 | languageLabel: string; | 12 | languageLabel: string; |
12 | language: string; | 13 | language: number; |
13 | description: string; | 14 | description: string; |
14 | duration: string; | 15 | duration: number; |
16 | durationLabel: string; | ||
15 | id: string; | 17 | id: string; |
16 | isLocal: boolean; | 18 | isLocal: boolean; |
17 | magnetUri: string; | 19 | magnetUri: string; |
@@ -41,11 +43,11 @@ export class Video { | |||
41 | author: string, | 43 | author: string, |
42 | createdAt: string, | 44 | createdAt: string, |
43 | categoryLabel: string, | 45 | categoryLabel: string, |
44 | category: string, | 46 | category: number, |
45 | licenceLabel: string, | 47 | licenceLabel: string, |
46 | licence: string, | 48 | licence: number, |
47 | languageLabel: string; | 49 | languageLabel: string; |
48 | language: string; | 50 | language: number; |
49 | description: string, | 51 | description: string, |
50 | duration: number; | 52 | duration: number; |
51 | id: string, | 53 | id: string, |
@@ -69,7 +71,8 @@ export class Video { | |||
69 | this.languageLabel = hash.languageLabel; | 71 | this.languageLabel = hash.languageLabel; |
70 | this.language = hash.language; | 72 | this.language = hash.language; |
71 | this.description = hash.description; | 73 | this.description = hash.description; |
72 | this.duration = Video.createDurationString(hash.duration); | 74 | this.duration = hash.duration; |
75 | this.durationLabel = Video.createDurationString(hash.duration); | ||
73 | this.id = hash.id; | 76 | this.id = hash.id; |
74 | this.isLocal = hash.isLocal; | 77 | this.isLocal = hash.isLocal; |
75 | this.magnetUri = hash.magnetUri; | 78 | this.magnetUri = hash.magnetUri; |
diff --git a/client/src/app/videos/video-list/video-miniature.component.html b/client/src/app/videos/video-list/video-miniature.component.html index 648ef61b1..b1b881fea 100644 --- a/client/src/app/videos/video-list/video-miniature.component.html +++ b/client/src/app/videos/video-list/video-miniature.component.html | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | <div class="video-miniature-thumbnail-overlay"> | 11 | <div class="video-miniature-thumbnail-overlay"> |
12 | <span class="video-miniature-thumbnail-overlay-views">{{ video.views }} views</span> | 12 | <span class="video-miniature-thumbnail-overlay-views">{{ video.views }} views</span> |
13 | <span class="video-miniature-thumbnail-overlay-duration">{{ video.duration }}</span> | 13 | <span class="video-miniature-thumbnail-overlay-duration">{{ video.durationLabel }}</span> |
14 | </div> | 14 | </div> |
15 | </a> | 15 | </a> |
16 | 16 | ||