})
}
+ static loadByUrl (url: string, t: Sequelize.Transaction) {
+ return VideoShareModel.scope(ScopeNames.FULL).findOne({
+ where: {
+ url
+ },
+ transaction: t
+ })
+ }
+
static loadActorsByShare (videoId: number, t: Sequelize.Transaction) {
const query = {
where: {
.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)
+ }
}