aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video/video.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/video/video.model.ts')
-rw-r--r--client/src/app/shared/video/video.model.ts12
1 files changed, 2 insertions, 10 deletions
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 @@
1import { Account } from '@app/shared/account/account.model'
1import { User } from '../' 2import { User } from '../'
2import { Video as VideoServerModel } from '../../../../../shared' 3import { Video as VideoServerModel } from '../../../../../shared'
3import { Account } from '../../../../../shared/models/actors'
4import { environment } from '../../../environments/environment'
5import { getAbsoluteAPIUrl } from '../misc/utils' 4import { getAbsoluteAPIUrl } from '../misc/utils'
6 5
7export class Video implements VideoServerModel { 6export class Video implements VideoServerModel {
@@ -35,13 +34,6 @@ export class Video implements VideoServerModel {
35 nsfw: boolean 34 nsfw: boolean
36 account: Account 35 account: Account
37 36
38 private static createByString (account: string, serverHost: string, apiURL: string) {
39 const thisHost = new URL(apiURL).host
40 if (serverHost.trim() === thisHost)
41 return account
42 return account + '@' + serverHost
43 }
44
45 private static createDurationString (duration: number) { 37 private static createDurationString (duration: number) {
46 const minutes = Math.floor(duration / 60) 38 const minutes = Math.floor(duration / 60)
47 const seconds = duration % 60 39 const seconds = duration % 60
@@ -81,7 +73,7 @@ export class Video implements VideoServerModel {
81 this.dislikes = hash.dislikes 73 this.dislikes = hash.dislikes
82 this.nsfw = hash.nsfw 74 this.nsfw = hash.nsfw
83 75
84 this.by = Video.createByString(hash.accountName, hash.serverHost, absoluteAPIUrl) 76 this.by = Account.CREATE_BY_STRING(hash.accountName, hash.serverHost)
85 } 77 }
86 78
87 isVideoNSFWForUser (user: User) { 79 isVideoNSFWForUser (user: User) {