- [ScopeNames.AVAILABLE_FOR_LIST]: (options: AvailableForListOptions) => {
- const actorIdNumber = parseInt(options.actorId + '', 10)
+ [ScopeNames.SUMMARY]: (withAccount = false) => {
+ const base: IFindOptions<VideoChannelModel> = {
+ attributes: [ 'name', 'description', 'id', 'actorId' ],
+ include: [
+ {
+ attributes: [ 'uuid', 'preferredUsername', 'url', 'serverId', 'avatarId' ],
+ model: ActorModel.unscoped(),
+ required: true,
+ include: [
+ {
+ attributes: [ 'host' ],
+ model: ServerModel.unscoped(),
+ required: false
+ },
+ {
+ model: AvatarModel.unscoped(),
+ required: false
+ }
+ ]
+ }
+ ]
+ }
+
+ if (withAccount === true) {
+ base.include.push({
+ model: AccountModel.scope(AccountModelScopeNames.SUMMARY),
+ required: true
+ })
+ }