From 154898b0b7bc1af41fc5a94974e338a3590c90f3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sat, 17 Jun 2017 11:28:11 +0200 Subject: Share models between server and client --- client/src/app/videos/video-watch/video-watch.component.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client/src/app/videos/video-watch/video-watch.component.ts') 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 4a547f7e4..808e0eda9 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts @@ -11,15 +11,15 @@ import { AuthService, ConfirmService } from '../../core' import { VideoMagnetComponent } from './video-magnet.component' import { VideoShareComponent } from './video-share.component' import { VideoReportComponent } from './video-report.component' -import { RateType, Video, VideoService } from '../shared' +import { Video, VideoService } from '../shared' import { WebTorrentService } from './webtorrent.service' +import { UserVideoRateType, VideoRateType, UserVideoRate } from '../../../../../shared' @Component({ selector: 'my-video-watch', templateUrl: './video-watch.component.html', styleUrls: [ './video-watch.component.scss' ] }) - export class VideoWatchComponent implements OnInit, OnDestroy { private static LOADTIME_TOO_LONG = 20000 @@ -34,7 +34,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { player: videojs.Player playerElement: Element uploadSpeed: number - userRating: RateType = null + userRating: UserVideoRateType = null video: Video = null videoNotFound = false @@ -249,7 +249,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.videoService.getUserVideoRating(this.video.id) .subscribe( - ratingObject => { + (ratingObject: UserVideoRate) => { if (ratingObject) { this.userRating = ratingObject.rating } @@ -282,7 +282,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { ) } - private updateVideoRating (oldRating: RateType, newRating: RateType) { + private updateVideoRating (oldRating: UserVideoRateType, newRating: VideoRateType) { let likesToIncrement = 0 let dislikesToIncrement = 0 -- cgit v1.2.3