attributes: [ 'name', 'description', 'id', 'actorId' ],
include: [
{
- attributes: [ 'uuid', 'preferredUsername', 'url', 'serverId', 'avatarId' ],
+ attributes: [ 'preferredUsername', 'url', 'serverId', 'avatarId' ],
model: ActorModel.unscoped(),
required: true,
include: [
})
}
- static listByAccount (accountId: number) {
+ static listByAccount (options: {
+ accountId: number,
+ start: number,
+ count: number,
+ sort: string
+ }) {
const query = {
- order: getSort('createdAt'),
+ offset: options.start,
+ limit: options.count,
+ order: getSort(options.sort),
include: [
{
model: AccountModel,
where: {
- id: accountId
+ id: options.accountId
},
required: true
}
.findByPk(id)
}
- static loadByUUIDAndPopulateAccount (uuid: string) {
- const query = {
- include: [
- {
- model: ActorModel,
- required: true,
- where: {
- uuid
- }
- }
- ]
- }
-
- return VideoChannelModel
- .scope([ ScopeNames.WITH_ACCOUNT ])
- .findOne(query)
- }
-
static loadByUrlAndPopulateAccount (url: string) {
const query = {
include: [
return {
id: this.id,
- uuid: actor.uuid,
name: actor.name,
displayName: this.getDisplayName(),
url: actor.url,