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',
include: [
{
model: () => ActorModel.unscoped(),
- required: true
+ required: true,
+ include: [
+ {
+ model: () => AvatarModel.unscoped(),
+ required: false
+ }
+ ]
}
]
}
indexes: [
{
fields: [ 'accountId' ]
+ },
+ {
+ fields: [ 'actorId' ]
}
]
})
}
if (instance.Actor.isOwned()) {
- logger.debug('Sending delete of actor of video channel %s.', instance.Actor.url)
-
return sendDeleteActor(instance.Actor, options.transaction)
}
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(),
]
})
}
+
+ getDisplayName () {
+ return this.name
+ }
}