diff options
Diffstat (limited to 'server/models/video/video-caption.ts')
-rw-r--r-- | server/models/video/video-caption.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/models/video/video-caption.ts b/server/models/video/video-caption.ts index bbda0f3ee..5ec944b9e 100644 --- a/server/models/video/video-caption.ts +++ b/server/models/video/video-caption.ts | |||
@@ -91,9 +91,9 @@ export class VideoCaptionModel extends Model<Partial<AttributesOnly<VideoCaption | |||
91 | Video: VideoModel | 91 | Video: VideoModel |
92 | 92 | ||
93 | @BeforeDestroy | 93 | @BeforeDestroy |
94 | static async removeFiles (instance: VideoCaptionModel) { | 94 | static async removeFiles (instance: VideoCaptionModel, options) { |
95 | if (!instance.Video) { | 95 | if (!instance.Video) { |
96 | instance.Video = await instance.$get('Video') | 96 | instance.Video = await instance.$get('Video', { transaction: options.transaction }) |
97 | } | 97 | } |
98 | 98 | ||
99 | if (instance.isOwned()) { | 99 | if (instance.isOwned()) { |
@@ -113,8 +113,7 @@ export class VideoCaptionModel extends Model<Partial<AttributesOnly<VideoCaption | |||
113 | const videoInclude = { | 113 | const videoInclude = { |
114 | model: VideoModel.unscoped(), | 114 | model: VideoModel.unscoped(), |
115 | attributes: [ 'id', 'remote', 'uuid' ], | 115 | attributes: [ 'id', 'remote', 'uuid' ], |
116 | where: buildWhereIdOrUUID(videoId), | 116 | where: buildWhereIdOrUUID(videoId) |
117 | transaction | ||
118 | } | 117 | } |
119 | 118 | ||
120 | const query = { | 119 | const query = { |
@@ -123,7 +122,8 @@ export class VideoCaptionModel extends Model<Partial<AttributesOnly<VideoCaption | |||
123 | }, | 122 | }, |
124 | include: [ | 123 | include: [ |
125 | videoInclude | 124 | videoInclude |
126 | ] | 125 | ], |
126 | transaction | ||
127 | } | 127 | } |
128 | 128 | ||
129 | return VideoCaptionModel.findOne(query) | 129 | return VideoCaptionModel.findOne(query) |