aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 8c49bc3af..b6a2ce6b5 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -491,6 +491,18 @@ export class VideoModel extends Model<VideoModel> {
491 return VideoModel.findById(id) 491 return VideoModel.findById(id)
492 } 492 }
493 493
494 static loadByUrl (url: string, t?: Sequelize.Transaction) {
495 const query: IFindOptions<VideoModel> = {
496 where: {
497 url
498 }
499 }
500
501 if (t !== undefined) query.transaction = t
502
503 return VideoModel.findOne(query)
504 }
505
494 static loadByUrlAndPopulateAccount (url: string, t?: Sequelize.Transaction) { 506 static loadByUrlAndPopulateAccount (url: string, t?: Sequelize.Transaction) {
495 const query: IFindOptions<VideoModel> = { 507 const query: IFindOptions<VideoModel> = {
496 where: { 508 where: {