}
static loadByUrl (url: string, t: Sequelize.Transaction) {
- return VideoShareModel.scope(ScopeNames.WITH_ACTOR).findOne({
+ return VideoShareModel.scope(ScopeNames.FULL).findOne({
where: {
url
},
.findAll(query)
.then(res => res.map(r => r.Actor))
}
+
+ static listAndCountByVideoId (videoId: number, start: number, count: number, t?: Sequelize.Transaction) {
+ const query = {
+ offset: start,
+ limit: count,
+ where: {
+ videoId
+ },
+ transaction: t
+ }
+
+ return VideoShareModel.findAndCountAll(query)
+ }
}