From ccf6ed16f1eeb05b77103bd44bc06ccbbbba9bdd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 May 2016 17:25:52 +0200 Subject: Do not prefix private attributes --- client/app/videos/shared/video.model.ts | 6 +++--- client/app/videos/shared/video.service.ts | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'client/app/videos/shared') diff --git a/client/app/videos/shared/video.model.ts b/client/app/videos/shared/video.model.ts index eec537c9e..2b018ad86 100644 --- a/client/app/videos/shared/video.model.ts +++ b/client/app/videos/shared/video.model.ts @@ -11,7 +11,7 @@ export class Video { by: string; duration: string; - private static createDurationString(duration: number): string { + private static createDurationString(duration: number) { const minutes = Math.floor(duration / 60); const seconds = duration % 60; const minutes_padding = minutes >= 10 ? '' : '0'; @@ -20,7 +20,7 @@ export class Video { return minutes_padding + minutes.toString() + ':' + seconds_padding + seconds.toString(); } - private static createByString(author: string, podUrl: string): string { + private static createByString(author: string, podUrl: string) { let [ host, port ] = podUrl.replace(/^https?:\/\//, '').split(':'); if (port === '80' || port === '443') { @@ -57,7 +57,7 @@ export class Video { this.by = Video.createByString(hash.author, hash.podUrl); } - isRemovableBy(user): boolean { + isRemovableBy(user) { return this.isLocal === true && user && this.author === user.username; } } diff --git a/client/app/videos/shared/video.service.ts b/client/app/videos/shared/video.service.ts index 78789c3cc..b6e0800a0 100644 --- a/client/app/videos/shared/video.service.ts +++ b/client/app/videos/shared/video.service.ts @@ -10,30 +10,30 @@ import { Video } from './video.model'; @Injectable() export class VideoService { - private _baseVideoUrl = '/api/v1/videos/'; + private static BASE_VIDEO_URL = '/api/v1/videos/'; - constructor (private http: Http, private _authService: AuthService) {} + constructor(private http: Http, private authService: AuthService) {} getVideos(pagination: Pagination, sort: SortField) { const params = this.createPaginationParams(pagination); if (sort) params.set('sort', sort); - return this.http.get(this._baseVideoUrl, { search: params }) + return this.http.get(VideoService.BASE_VIDEO_URL, { search: params }) .map(res => res.json()) .map(this.extractVideos) .catch(this.handleError); } getVideo(id: string) { - return this.http.get(this._baseVideoUrl + id) + return this.http.get(VideoService.BASE_VIDEO_URL + id) .map(res =>