From 66dd264f7b15c05006faa00694c88c56794edc54 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 11 Jun 2017 11:29:03 +0200 Subject: Better build/dev scripts --- client/src/app/core/auth/auth-user.model.ts | 3 +++ client/src/app/core/auth/auth.service.ts | 3 ++- client/src/app/videos/video-watch/video-watch.component.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'client/src') diff --git a/client/src/app/core/auth/auth-user.model.ts b/client/src/app/core/auth/auth-user.model.ts index 7115b9781..f827bd6ca 100644 --- a/client/src/app/core/auth/auth-user.model.ts +++ b/client/src/app/core/auth/auth-user.model.ts @@ -5,6 +5,7 @@ export class AuthUser extends User { private static KEYS = { ID: 'id', ROLE: 'role', + EMAIL: 'email', USERNAME: 'username', DISPLAY_NSFW: 'display_nsfw' }; @@ -18,6 +19,7 @@ export class AuthUser extends User { { id: parseInt(localStorage.getItem(this.KEYS.ID)), username: localStorage.getItem(this.KEYS.USERNAME), + email: localStorage.getItem(this.KEYS.EMAIL), role: localStorage.getItem(this.KEYS.ROLE), displayNSFW: localStorage.getItem(this.KEYS.DISPLAY_NSFW) === 'true' }, @@ -40,6 +42,7 @@ export class AuthUser extends User { id: number, username: string, role: string, + email: string, displayNSFW: boolean }, hashTokens: any) { super(userHash); diff --git a/client/src/app/core/auth/auth.service.ts b/client/src/app/core/auth/auth.service.ts index 00a4216ef..caf765b42 100644 --- a/client/src/app/core/auth/auth.service.ts +++ b/client/src/app/core/auth/auth.service.ts @@ -218,6 +218,7 @@ export class AuthService { const id = obj.id; const username = obj.username; const role = obj.role; + const email = obj.email; const displayNSFW = obj.displayNSFW; const hashTokens = { access_token: obj.access_token, @@ -225,7 +226,7 @@ export class AuthService { refresh_token: obj.refresh_token }; - this.user = new AuthUser({ id, username, role, displayNSFW }, hashTokens); + this.user = new AuthUser({ id, username, role, displayNSFW, email }, hashTokens); this.user.save(); this.setStatus(AuthStatus.LoggedIn); diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts index 756f66726..d4b60b001 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts @@ -313,7 +313,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.metaService.setTag('og:image', this.video.thumbnailPath); - this.metaService.setTag('og:duration', this.video.duration); + this.metaService.setTag('og:duration', this.video.duration.toString()); this.metaService.setTag('og:site_name', 'PeerTube'); -- cgit v1.2.3