const inQueryInstanceFollow = '(' +
'SELECT "actor"."serverId" FROM "actorFollow" ' +
'INNER JOIN "actor" ON actor.id= "actorFollow"."targetActorId" ' +
- 'WHERE "actor"."id" = ' + actorIdNumber +
+ 'WHERE "actorFollow"."actorId" = ' + actorIdNumber +
')'
return {
})
}
+ static listLocalsForSitemap (sort: string) {
+ const query = {
+ attributes: [ ],
+ offset: 0,
+ order: getSort(sort),
+ include: [
+ {
+ attributes: [ 'preferredUsername', 'serverId' ],
+ model: ActorModel.unscoped(),
+ where: {
+ serverId: null
+ }
+ }
+ ]
+ }
+
+ return VideoChannelModel
+ .unscoped()
+ .findAll(query)
+ }
+
static searchForApi (options: {
actorId: number
search: string
})
}
+ static loadByIdAndPopulateAccount (id: number) {
+ return VideoChannelModel.unscoped()
+ .scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
+ .findById(id)
+ }
+
static loadByIdAndAccount (id: number, accountId: number) {
const query = {
where: {
}
}
- return VideoChannelModel
+ return VideoChannelModel.unscoped()
.scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
.findOne(query)
}
static loadAndPopulateAccount (id: number) {
- return VideoChannelModel
+ return VideoChannelModel.unscoped()
.scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
.findById(id)
}
]
}
- return VideoChannelModel
+ return VideoChannelModel.unscoped()
.scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
.findOne(query)
}
]
}
- return VideoChannelModel
+ return VideoChannelModel.unscoped()
.scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT ])
.findOne(query)
}
]
}
- return VideoChannelModel
+ return VideoChannelModel.unscoped()
.scope([ ScopeNames.WITH_ACTOR, ScopeNames.WITH_ACCOUNT, ScopeNames.WITH_VIDEOS ])
.findById(id, options)
}
getDisplayName () {
return this.name
}
+
+ isOutdated () {
+ return this.Actor.isOutdated()
+ }
}