X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-channel.ts;h=4251afce994d00ab7999b2fb92420b36b8d7bec1;hb=f4001cf408a99049d01a356bfb20a62342de06ea;hp=b9df14eca77c6fd70d841a749a108a24d1a2a2a1;hpb=a4f99a766bd07851a37dd7ff8fed7acc2a3ef021;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-channel.ts b/server/models/video/video-channel.ts index b9df14eca..4251afce9 100644 --- a/server/models/video/video-channel.ts +++ b/server/models/video/video-channel.ts @@ -15,6 +15,7 @@ import { ActorModel } from '../activitypub/actor' import { getSort, throwIfNotValid } from '../utils' import { VideoModel } from './video' import { CONSTRAINTS_FIELDS } from '../../initializers' +import { AvatarModel } from '../avatar/avatar' enum ScopeNames { WITH_ACCOUNT = 'WITH_ACCOUNT', @@ -39,7 +40,13 @@ enum ScopeNames { include: [ { model: () => ActorModel.unscoped(), - required: true + required: true, + include: [ + { + model: () => AvatarModel.unscoped(), + required: false + } + ] } ] } @@ -237,7 +244,7 @@ export class VideoChannelModel extends Model { const actor = this.Actor.toFormattedJSON() const videoChannel = { id: this.id, - displayName: this.name, + displayName: this.getDisplayName(), description: this.description, support: this.support, isLocal: this.Actor.isOwned(), @@ -266,4 +273,8 @@ export class VideoChannelModel extends Model { ] }) } + + getDisplayName () { + return this.name + } }