From 7d026caf683e42fd57a243a3b52a5e4f476fbb4e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 28 Apr 2021 15:59:46 +0200 Subject: Remove avatarUrl from models --- client/src/app/shared/shared-main/account/account.model.ts | 9 --------- client/src/app/shared/shared-main/account/actor.model.ts | 1 - .../app/shared/shared-main/video-channel/video-channel.model.ts | 3 --- client/src/app/shared/shared-main/video/video.model.ts | 3 --- 4 files changed, 16 deletions(-) (limited to 'client/src/app/shared/shared-main') diff --git a/client/src/app/shared/shared-main/account/account.model.ts b/client/src/app/shared/shared-main/account/account.model.ts index c90bafa5c..6d9f0ee65 100644 --- a/client/src/app/shared/shared-main/account/account.model.ts +++ b/client/src/app/shared/shared-main/account/account.model.ts @@ -24,8 +24,6 @@ export class Account extends Actor implements ServerAccount { constructor (hash: ServerAccount) { super(hash) - this.updateComputedAttributes() - this.displayName = hash.displayName this.description = hash.description this.userId = hash.userId @@ -40,16 +38,9 @@ export class Account extends Actor implements ServerAccount { updateAvatar (newAvatar: ActorImage) { this.avatar = newAvatar - - this.updateComputedAttributes() } resetAvatar () { this.avatar = null - this.avatarUrl = null - } - - private updateComputedAttributes () { - this.avatarUrl = Account.GET_ACTOR_AVATAR_URL(this) } } diff --git a/client/src/app/shared/shared-main/account/actor.model.ts b/client/src/app/shared/shared-main/account/actor.model.ts index 4b036341f..6ba0bb09e 100644 --- a/client/src/app/shared/shared-main/account/actor.model.ts +++ b/client/src/app/shared/shared-main/account/actor.model.ts @@ -15,7 +15,6 @@ export abstract class Actor implements ServerActor { updatedAt: Date | string avatar: ActorImage - avatarUrl: string isLocal: boolean diff --git a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts index 548725e04..c40dd5311 100644 --- a/client/src/app/shared/shared-main/video-channel/video-channel.model.ts +++ b/client/src/app/shared/shared-main/video-channel/video-channel.model.ts @@ -18,7 +18,6 @@ export class VideoChannel extends Actor implements ServerVideoChannel { ownerAccount?: ServerAccount ownerBy?: string - ownerAvatarUrl?: string videosCount?: number @@ -67,7 +66,6 @@ export class VideoChannel extends Actor implements ServerVideoChannel { if (hash.ownerAccount) { this.ownerAccount = hash.ownerAccount this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host) - this.ownerAvatarUrl = Account.GET_ACTOR_AVATAR_URL(this.ownerAccount) } this.updateComputedAttributes() @@ -94,7 +92,6 @@ export class VideoChannel extends Actor implements ServerVideoChannel { } updateComputedAttributes () { - this.avatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this) this.bannerUrl = VideoChannel.GET_ACTOR_BANNER_URL(this) } } diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index 14c507295..526d10e32 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -20,8 +20,6 @@ export class Video implements VideoServerModel { byVideoChannel: string byAccount: string - videoChannelAvatarUrl: string - createdAt: Date updatedAt: Date publishedAt: Date @@ -143,7 +141,6 @@ export class Video implements VideoServerModel { this.byAccount = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host) this.byVideoChannel = Actor.CREATE_BY_STRING(hash.channel.name, hash.channel.host) - this.videoChannelAvatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this.channel) this.category.label = peertubeTranslate(this.category.label, translations) this.licence.label = peertubeTranslate(this.licence.label, translations) -- cgit v1.2.3