ActivityPub-federated video streaming platform using P2P directly in your web browser
Remove avatarUrl from models
Chocobozzz7d026caf683e
diff --git a/client/src/app/+videos/+video-watch/video-avatar-channel.component.html b/client/src/app/+videos/+video-watch/video-avatar-channel.component.htmlindex b8b5d7843c..5f149cbd11 100644--- a/client/src/app/+videos/+video-watch/video-avatar-channel.component.html+++ b/client/src/app/+videos/+video-watch/video-avatar-channel.component.html@@ -1,21 +1,11 @@-<div class="wrapper" [ngClass]="'avatar-' + size">- <ng-container *ngIf="!isChannelAvatarNull() && !genericChannel">- <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">- <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" class="channel-avatar" />- </a>-- <my-actor-avatar [account]="video.account" [title]="accountLinkTitle" [internalHref]="[ '/accounts', video.byAccount ]"></my-actor-avatar>-</ng-container>-- <ng-container *ngIf="!isChannelAvatarNull() && genericChannel">- <my-actor-avatar [account]="video.account" [title]="accountLinkTitle" [internalHref]="[ '/accounts', video.byAccount ]"></my-actor-avatar>-- <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">- <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" class="channel-avatar" />- </a>- </ng-container>-- <ng-container *ngIf="isChannelAvatarNull()">- <my-actor-avatar [account]="video.account" [title]="accountLinkTitle" [internalHref]="[ '/accounts', video.byAccount ]"></my-actor-avatar>- </ng-container>+<div class="wrapper" [ngClass]="{ 'generic-channel': genericChannel }">+ <my-actor-avatar+ class="channel" [channel]="video.channel"+ [internalHref]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle"+ ></my-actor-avatar>++ <my-actor-avatar+ class="account" [account]="video.account"+ [internalHref]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle">+ </my-actor-avatar></div>diff --git a/client/src/app/+videos/+video-watch/video-avatar-channel.component.scss b/client/src/app/+videos/+video-watch/video-avatar-channel.component.scssindex 4998e85faa..20e32240cd 100644--- a/client/src/app/+videos/+video-watch/video-avatar-channel.component.scss+++ b/client/src/app/+videos/+video-watch/video-avatar-channel.component.scss@@ -1,44 +1,42 @@@import '_mixins';+@mixin main {+ @include actor-avatar-size(35px);+}++@mixin secondary {+ height: 60%;+ width: 60%;+ position: absolute;+ bottom: -5px;+ right: -5px;+ background-color: rgba(0, 0, 0, 0);+}+.wrapper {- $avatar-size: 35px;+ @include actor-avatar-size(35px);- width: $avatar-size;- height: $avatar-size;position: relative;margin-right: 5px;margin-bottom: 5px;- &.avatar-sm {- width: 28px;- height: 28px;- margin-bottom: 3px;- }+ &.generic-channel {+ .account {+ @include main();+ }- a {- @include disable-outline;+ .channel {+ display: none !important;+ }}- a img {- height: 100%;- object-fit: cover;- position: absolute;- top:50%;- left:50%;- transform: translate(-50%,-50%);- border-radius: 5px;-- &:not(.channel-avatar) {- border-radius: 50%;+ &:not(.generic-channel) {+ .account {+ @include secondary();}- }- a:nth-of-type(2) img {- height: 60%;- width: 60%;- border: 2px solid pvar(--mainBackgroundColor);- transform: translateX(15%);- position: relative;- background-color: pvar(--mainBackgroundColor);+ .channel {+ @include main();+ }}}diff --git a/client/src/app/+videos/+video-watch/video-avatar-channel.component.ts b/client/src/app/+videos/+video-watch/video-avatar-channel.component.tsindex 0b6e796dff..63edd7badf 100644--- a/client/src/app/+videos/+video-watch/video-avatar-channel.component.ts+++ b/client/src/app/+videos/+video-watch/video-avatar-channel.component.ts@@ -10,7 +10,6 @@ export class VideoAvatarChannelComponent implements OnInit {@Input() video: Video@Input() byAccount: string- @Input() size: 'md' | 'sm' = 'md'@Input() genericChannel: booleanchannelLinkTitle = ''diff --git a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts b/client/src/app/shared/shared-actor-image/actor-avatar.component.tsindex 6bb3b65fa3..71e020cba1 100644--- a/client/src/app/shared/shared-actor-image/actor-avatar.component.ts+++ b/client/src/app/shared/shared-actor-image/actor-avatar.component.ts@@ -73,7 +73,7 @@ export class ActorAvatarComponent {get avatarUrl () {if (this.account) return Account.GET_ACTOR_AVATAR_URL(this.account)- if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.account)+ if (this.channel) return VideoChannel.GET_ACTOR_AVATAR_URL(this.channel)return ''}diff --git a/client/src/app/shared/shared-main/account/account.model.ts b/client/src/app/shared/shared-main/account/account.model.tsindex c90bafa5cf..6d9f0ee655 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.displayNamethis.description = hash.descriptionthis.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.tsindex 4b036341f6..6ba0bb09ed 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 | stringavatar: ActorImage- avatarUrl: stringisLocal: booleandiff --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.tsindex 548725e04d..c40dd53119 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?: ServerAccountownerBy?: string- ownerAvatarUrl?: stringvideosCount?: number@@ -67,7 +66,6 @@ export class VideoChannel extends Actor implements ServerVideoChannel {if (hash.ownerAccount) {this.ownerAccount = hash.ownerAccountthis.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.tsindex 14c507295a..526d10e32f 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: stringbyAccount: string- videoChannelAvatarUrl: string-createdAt: DateupdatedAt: DatepublishedAt: 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)diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts b/client/src/app/shared/shared-video-miniature/video-miniature.component.tsindex 8d66aaee2c..d74b70d4c1 100644--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.ts+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.ts@@ -180,14 +180,6 @@ export class VideoMiniatureComponent implements OnInit {return ''}- getAvatarUrl () {- if (this.displayOwnerAccount()) {- return this.video.account.avatar?.url- }-- return this.video.videoChannelAvatarUrl- }-loadActions () {if (this.displayVideoActions) this.showActions = truediff --git a/client/src/app/shared/shared-video-playlist/video-playlist.model.ts b/client/src/app/shared/shared-video-playlist/video-playlist.model.tsindex 9bec16d776..5b6ba9dbf2 100644--- a/client/src/app/shared/shared-video-playlist/video-playlist.model.ts+++ b/client/src/app/shared/shared-video-playlist/video-playlist.model.ts@@ -37,10 +37,8 @@ export class VideoPlaylist implements ServerVideoPlaylist {embedUrl: stringownerBy: string- ownerAvatarUrl: stringvideoChannelBy?: string- videoChannelAvatarUrl?: stringprivate thumbnailVersion: numberprivate originThumbnailUrl: string@@ -78,12 +76,10 @@ export class VideoPlaylist implements ServerVideoPlaylist {this.ownerAccount = hash.ownerAccountthis.ownerBy = Actor.CREATE_BY_STRING(hash.ownerAccount.name, hash.ownerAccount.host)- this.ownerAvatarUrl = Account.GET_ACTOR_AVATAR_URL(this.ownerAccount)if (hash.videoChannel) {this.videoChannel = hash.videoChannelthis.videoChannelBy = Actor.CREATE_BY_STRING(hash.videoChannel.name, hash.videoChannel.host)- this.videoChannelAvatarUrl = VideoChannel.GET_ACTOR_AVATAR_URL(this.videoChannel)}this.privacy.label = peertubeTranslate(this.privacy.label, translations)