<div class="pt-3 border-top video-info-channel d-flex">
<div class="video-info-channel-left d-flex">
- <avatar-channel [video]="video"></avatar-channel>
+ <avatar-channel [video]="video" [genericChannel]="isChannelDisplayNameGeneric()"></avatar-channel>
<div class="video-info-channel-left-links ml-1">
- <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" i18n-title title="Channel page">
- {{ video.channel.displayName }}
- </a>
- <a [routerLink]="[ '/accounts', video.byAccount ]" i18n-title title="Account page">
- <span i18n>By {{ video.byAccount }}</span>
- </a>
+ <ng-container *ngIf="!isChannelDisplayNameGeneric()">
+ <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" i18n-title title="Channel page">
+ {{ video.channel.displayName }}
+ </a>
+ <a [routerLink]="[ '/accounts', video.byAccount ]" i18n-title title="Account page">
+ <span i18n>By {{ video.byAccount }}</span>
+ </a>
+ </ng-container>
+
+ <ng-container *ngIf="isChannelDisplayNameGeneric()">
+ <a [routerLink]="[ '/accounts', video.byAccount ]" class="single-link" i18n-title title="Account page">
+ <span i18n>{{ video.byAccount }}</span>
+ </a>
+ </ng-container>
</div>
</div>
font-weight: 500;
font-size: 90%;
}
+
+ a.single-link {
+ margin-top: 7px;
+ }
}
}
)
}
+ isChannelDisplayNameGeneric () {
+ const genericChannelDisplayName = [
+ `Main ${this.video.channel.ownerAccount.name} channel`,
+ `Default ${this.video.channel.ownerAccount.name} channel`
+ ]
+
+ return genericChannelDisplayName.includes(this.video.channel.displayName)
+ }
+
private loadVideo (videoId: string) {
// Video did not change
if (this.video && this.video.uuid === videoId) return
<div class="wrapper" [ngClass]="'avatar-' + size">
- <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
- <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" />
- </a>
- <a [routerLink]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle">
- <img [src]="video.accountAvatarUrl" i18n-alt alt="Account avatar" />
- </a>
+ <ng-container *ngIf="!isChannelAvatarNull() && !genericChannel">
+ <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
+ <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" />
+ </a>
+ <a [routerLink]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle">
+ <img [src]="video.accountAvatarUrl" i18n-alt alt="Account avatar" />
+ </a>
+ </ng-container>
+
+ <ng-container *ngIf="!isChannelAvatarNull() && genericChannel">
+ <a [routerLink]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle">
+ <img [src]="video.accountAvatarUrl" i18n-alt alt="Account avatar" />
+ </a>
+
+ <a [routerLink]="[ '/video-channels', video.byVideoChannel ]" [title]="channelLinkTitle">
+ <img [src]="video.videoChannelAvatarUrl" i18n-alt alt="Channel avatar" />
+ </a>
+ </ng-container>
+
+ <ng-container *ngIf="isChannelAvatarNull()">
+ <a [routerLink]="[ '/accounts', video.byAccount ]" [title]="accountLinkTitle">
+ <img [src]="video.accountAvatarUrl" i18n-alt alt="Account avatar" />
+ </a>
+ </ng-container>
</div>
export class AvatarComponent implements OnInit {
@Input() video: Video
@Input() size: 'md' | 'sm' = 'md'
+ @Input() genericChannel: boolean
channelLinkTitle = ''
accountLinkTitle = ''
{ name: this.video.account.name, handle: this.video.byAccount }
)
}
+
+ isChannelAvatarNull () {
+ return this.video.channel.avatar === null
+ }
}