- static loadByUrl (url: string, t?: Sequelize.Transaction) {
- const query: IFindOptions<VideoChannelModel> = {
- include: [
- {
- model: ActorModel,
- required: true,
- where: {
- url
- }
- }
- ]
- }
-
- if (t !== undefined) query.transaction = t
-
- return VideoChannelModel.scope(ScopeNames.WITH_ACCOUNT).findOne(query)
- }
-
- static loadByUUIDOrUrl (uuid: string, url: string, t?: Sequelize.Transaction) {
- const query: IFindOptions<VideoChannelModel> = {
- where: {
- [ Sequelize.Op.or ]: [
- { uuid },
- { url }
- ]
- }
- }
-
- if (t !== undefined) query.transaction = t
-
- return VideoChannelModel.findOne(query)
- }
-