+loadByUrl = function (url: string, t?: Sequelize.Transaction) {
+ const query: Sequelize.FindOptions<VideoChannelAttributes> = {
+ where: {
+ url
+ },
+ include: [ VideoChannel['sequelize'].models.Account ]
+ }
+
+ if (t !== undefined) query.transaction = t
+
+ return VideoChannel.findOne(query)
+}
+
+loadByUUIDOrUrl = function (uuid: string, url: string, t?: Sequelize.Transaction) {
+ const query: Sequelize.FindOptions<VideoChannelAttributes> = {
+ where: {
+ [Sequelize.Op.or]: [
+ { uuid },
+ { url }
+ ]
+ }
+ }
+
+ if (t !== undefined) query.transaction = t
+
+ return VideoChannel.findOne(query)
+}
+