aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-04-28 15:59:46 +0200
committerChocobozzz <me@florianbigard.com>2021-04-28 15:59:46 +0200
commit7d026caf683e42fd57a243a3b52a5e4f476fbb4e (patch)
treeaf2b695e2470f709727f3ff24828198b7d0fd0fe /client/src/app/shared/shared-main
parent746018f6b81b40e8858303662ac9ec5ce59ac6eb (diff)
downloadPeerTube-7d026caf683e42fd57a243a3b52a5e4f476fbb4e.tar.gz
PeerTube-7d026caf683e42fd57a243a3b52a5e4f476fbb4e.tar.zst
PeerTube-7d026caf683e42fd57a243a3b52a5e4f476fbb4e.zip
Remove avatarUrl from models
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r--client/src/app/shared/shared-main/account/account.model.ts9
-rw-r--r--client/src/app/shared/shared-main/account/actor.model.ts1
-rw-r--r--client/src/app/shared/shared-main/video-channel/video-channel.model.ts3
-rw-r--r--client/src/app/shared/shared-main/video/video.model.ts3
4 files changed, 0 insertions, 16 deletions
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 {
24 constructor (hash: ServerAccount) { 24 constructor (hash: ServerAccount) {
25 super(hash) 25 super(hash)
26 26
27 this.updateComputedAttributes()
28
29 this.displayName = hash.displayName 27 this.displayName = hash.displayName
30 this.description = hash.description 28 this.description = hash.description
31 this.userId = hash.userId 29 this.userId = hash.userId
@@ -40,16 +38,9 @@ export class Account extends Actor implements ServerAccount {
40 38
41 updateAvatar (newAvatar: ActorImage) { 39 updateAvatar (newAvatar: ActorImage) {
42 this.avatar = newAvatar 40 this.avatar = newAvatar
43
44 this.updateComputedAttributes()
45 } 41 }
46 42
47 resetAvatar () { 43 resetAvatar () {
48 this.avatar = null 44 this.avatar = null
49 this.avatarUrl = null
50 }
51
52 private updateComputedAttributes () {
53 this.avatarUrl = Account.GET_ACTOR_AVATAR_URL(this)
54 } 45 }
55} 46}
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 {
15 updatedAt: Date | string 15 updatedAt: Date | string
16 16
17 avatar: ActorImage 17 avatar: ActorImage
18 avatarUrl: string
19 18
20 isLocal: boolean 19 isLocal: boolean
21 20
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 {
18 18
19 ownerAccount?: ServerAccount 19 ownerAccount?: ServerAccount
20 ownerBy?: string 20 ownerBy?: string
21 ownerAvatarUrl?: string
22 21
23 videosCount?: number 22 videosCount?: number
24 23
@@ -67,7 +66,6 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
67 if (hash.ownerAccount) { 66 if (hash.ownerAccount) {
68 this.ownerAccount = hash.ownerAccount 67 this.ownerAccount = hash.ownerAccount
69 this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host) 68 this.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host)
70 this.ownerAvatarUrl = Account.GET_ACTOR_AVATAR_URL(this.ownerAccount)
71 } 69 }
72 70
73 this.updateComputedAttributes() 71 this.updateComputedAttributes()
@@ -94,7 +92,6 @@ export class VideoChannel extends Actor implements ServerVideoChannel {
94 } 92 }
95 93
96 updateComputedAttributes () { 94 updateComputedAttributes () {
97 this.avatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this)
98 this.bannerUrl = VideoChannel.GET_ACTOR_BANNER_URL(this) 95 this.bannerUrl = VideoChannel.GET_ACTOR_BANNER_URL(this)
99 } 96 }
100} 97}
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 {
20 byVideoChannel: string 20 byVideoChannel: string
21 byAccount: string 21 byAccount: string
22 22
23 videoChannelAvatarUrl: string
24
25 createdAt: Date 23 createdAt: Date
26 updatedAt: Date 24 updatedAt: Date
27 publishedAt: Date 25 publishedAt: Date
@@ -143,7 +141,6 @@ export class Video implements VideoServerModel {
143 141
144 this.byAccount = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host) 142 this.byAccount = Actor.CREATE_BY_STRING(hash.account.name, hash.account.host)
145 this.byVideoChannel = Actor.CREATE_BY_STRING(hash.channel.name, hash.channel.host) 143 this.byVideoChannel = Actor.CREATE_BY_STRING(hash.channel.name, hash.channel.host)
146 this.videoChannelAvatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this.channel)
147 144
148 this.category.label = peertubeTranslate(this.category.label, translations) 145 this.category.label = peertubeTranslate(this.category.label, translations)
149 this.licence.label = peertubeTranslate(this.licence.label, translations) 146 this.licence.label = peertubeTranslate(this.licence.label, translations)