From 76d36e0b355f41fb46709ba5e39c59b10087c6a9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 8 Jan 2018 10:35:54 +0100 Subject: Refractor account by --- client/src/app/shared/video/video.model.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'client/src/app/shared/video') diff --git a/client/src/app/shared/video/video.model.ts b/client/src/app/shared/video/video.model.ts index a4b90ad94..79351ba2a 100644 --- a/client/src/app/shared/video/video.model.ts +++ b/client/src/app/shared/video/video.model.ts @@ -1,7 +1,6 @@ +import { Account } from '@app/shared/account/account.model' import { User } from '../' import { Video as VideoServerModel } from '../../../../../shared' -import { Account } from '../../../../../shared/models/actors' -import { environment } from '../../../environments/environment' import { getAbsoluteAPIUrl } from '../misc/utils' export class Video implements VideoServerModel { @@ -35,13 +34,6 @@ export class Video implements VideoServerModel { nsfw: boolean account: Account - private static createByString (account: string, serverHost: string, apiURL: string) { - const thisHost = new URL(apiURL).host - if (serverHost.trim() === thisHost) - return account - return account + '@' + serverHost - } - private static createDurationString (duration: number) { const minutes = Math.floor(duration / 60) const seconds = duration % 60 @@ -81,7 +73,7 @@ export class Video implements VideoServerModel { this.dislikes = hash.dislikes this.nsfw = hash.nsfw - this.by = Video.createByString(hash.accountName, hash.serverHost, absoluteAPIUrl) + this.by = Account.CREATE_BY_STRING(hash.accountName, hash.serverHost) } isVideoNSFWForUser (user: User) { -- cgit v1.2.3