diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index ce2153f87..6c89c16bf 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -1103,14 +1103,24 @@ export class VideoModel extends Model<VideoModel> { | |||
1103 | .findOne(options) | 1103 | .findOne(options) |
1104 | } | 1104 | } |
1105 | 1105 | ||
1106 | static loadByUrlAndPopulateAccount (url: string, t?: Sequelize.Transaction) { | 1106 | static loadByUrl (url: string, transaction?: Sequelize.Transaction) { |
1107 | const query: IFindOptions<VideoModel> = { | 1107 | const query: IFindOptions<VideoModel> = { |
1108 | where: { | 1108 | where: { |
1109 | url | 1109 | url |
1110 | } | 1110 | }, |
1111 | transaction | ||
1111 | } | 1112 | } |
1112 | 1113 | ||
1113 | if (t !== undefined) query.transaction = t | 1114 | return VideoModel.findOne(query) |
1115 | } | ||
1116 | |||
1117 | static loadByUrlAndPopulateAccount (url: string, transaction?: Sequelize.Transaction) { | ||
1118 | const query: IFindOptions<VideoModel> = { | ||
1119 | where: { | ||
1120 | url | ||
1121 | }, | ||
1122 | transaction | ||
1123 | } | ||
1114 | 1124 | ||
1115 | return VideoModel.scope([ ScopeNames.WITH_ACCOUNT_DETAILS, ScopeNames.WITH_FILES ]).findOne(query) | 1125 | return VideoModel.scope([ ScopeNames.WITH_ACCOUNT_DETAILS, ScopeNames.WITH_FILES ]).findOne(query) |
1116 | } | 1126 | } |