aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-miniature
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-02-15 13:50:40 +0100
committerChocobozzz <me@florianbigard.com>2023-02-15 13:50:40 +0100
commit343d1395df2e07ea9eb3540724c9fd689e617cb8 (patch)
treeacd553f76c1daab05f4cf44c66234467c5ea9b36 /client/src/app/shared/shared-video-miniature
parent72c98d189ef7b18264a7f715d7a58910eba29a1c (diff)
downloadPeerTube-343d1395df2e07ea9eb3540724c9fd689e617cb8.tar.gz
PeerTube-343d1395df2e07ea9eb3540724c9fd689e617cb8.tar.zst
PeerTube-343d1395df2e07ea9eb3540724c9fd689e617cb8.zip
Prefer displaying channel for playlist element
Diffstat (limited to 'client/src/app/shared/shared-video-miniature')
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.html8
-rw-r--r--client/src/app/shared/shared-video-miniature/video-miniature.component.ts18
2 files changed, 6 insertions, 20 deletions
diff --git a/client/src/app/shared/shared-video-miniature/video-miniature.component.html b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
index 227c12130..7d3c3dbfc 100644
--- a/client/src/app/shared/shared-video-miniature/video-miniature.component.html
+++ b/client/src/app/shared/shared-video-miniature/video-miniature.component.html
@@ -40,11 +40,9 @@
40 </span> 40 </span>
41 </span> 41 </span>
42 42
43 <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerAccount()" class="video-miniature-account" [routerLink]="[ '/c', video.byVideoChannel ]"> 43 <a tabindex="-1" *ngIf="displayOptions.by" class="video-miniature-account" [routerLink]="[ '/c', video.byVideoChannel ]">
44 {{ authorAccount }} 44 <ng-container *ngIf="displayOwnerAccount()">{{ authorAccount }}</ng-container>
45 </a> 45 <ng-container *ngIf="displayOwnerVideoChannel()">{{ authorChannel }}</ng-container>
46 <a tabindex="-1" *ngIf="displayOptions.by && displayOwnerVideoChannel()" class="video-miniature-channel" [routerLink]="[ '/c', video.byVideoChannel ]">
47 {{ authorChannel }}
48 </a> 46 </a>
49 47
50 <div class="video-info-privacy"> 48 <div class="video-info-privacy">
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.ts
index 706227e66..2384b34d7 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
@@ -14,7 +14,7 @@ import { AuthService, ScreenService, ServerService, User } from '@app/core'
14import { HTMLServerConfig, VideoExistInPlaylist, VideoPlaylistType, VideoPrivacy, VideoState } from '@shared/models' 14import { HTMLServerConfig, VideoExistInPlaylist, VideoPlaylistType, VideoPrivacy, VideoState } from '@shared/models'
15import { LinkType } from '../../../types/link.type' 15import { LinkType } from '../../../types/link.type'
16import { ActorAvatarSize } from '../shared-actor-image/actor-avatar.component' 16import { ActorAvatarSize } from '../shared-actor-image/actor-avatar.component'
17import { Video } from '../shared-main' 17import { Video, VideoService } from '../shared-main'
18import { VideoPlaylistService } from '../shared-video-playlist' 18import { VideoPlaylistService } from '../shared-video-playlist'
19import { VideoActionsDisplayType } from './video-actions-dropdown.component' 19import { VideoActionsDisplayType } from './video-actions-dropdown.component'
20 20
@@ -103,6 +103,7 @@ export class VideoMiniatureComponent implements OnInit {
103 private serverService: ServerService, 103 private serverService: ServerService,
104 private authService: AuthService, 104 private authService: AuthService,
105 private videoPlaylistService: VideoPlaylistService, 105 private videoPlaylistService: VideoPlaylistService,
106 private videoService: VideoService,
106 private cd: ChangeDetectorRef, 107 private cd: ChangeDetectorRef,
107 @Inject(LOCALE_ID) private localeId: string 108 @Inject(LOCALE_ID) private localeId: string
108 ) {} 109 ) {}
@@ -276,20 +277,7 @@ export class VideoMiniatureComponent implements OnInit {
276 return 277 return
277 } 278 }
278 279
279 const accountName = this.video.account.name 280 this.ownerDisplayType = this.videoService.buildDefaultOwnerDisplayType(this.video)
280
281 // If the video channel name is an UUID (not really displayable, we changed this behaviour in v1.0.0-beta.12)
282 // Or has not been customized (default created channel display name)
283 // -> Use the account name
284 if (
285 this.video.channel.displayName === `Default ${accountName} channel` ||
286 this.video.channel.displayName === `Main ${accountName} channel` ||
287 this.video.channel.name.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/)
288 ) {
289 this.ownerDisplayType = 'account'
290 } else {
291 this.ownerDisplayType = 'videoChannel'
292 }
293 } 281 }
294 282
295 private loadWatchLater () { 283 private loadWatchLater () {