diff options
Diffstat (limited to 'server/lib/plugins/plugin-helpers-builder.ts')
-rw-r--r-- | server/lib/plugins/plugin-helpers-builder.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/plugins/plugin-helpers-builder.ts b/server/lib/plugins/plugin-helpers-builder.ts index 897271c0b..b76c0a8a4 100644 --- a/server/lib/plugins/plugin-helpers-builder.ts +++ b/server/lib/plugins/plugin-helpers-builder.ts | |||
@@ -83,7 +83,7 @@ function buildVideosHelpers () { | |||
83 | 83 | ||
84 | removeVideo: (id: number) => { | 84 | removeVideo: (id: number) => { |
85 | return sequelizeTypescript.transaction(async t => { | 85 | return sequelizeTypescript.transaction(async t => { |
86 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id, t) | 86 | const video = await VideoModel.loadFull(id, t) |
87 | 87 | ||
88 | await video.destroy({ transaction: t }) | 88 | await video.destroy({ transaction: t }) |
89 | }) | 89 | }) |
@@ -94,7 +94,7 @@ function buildVideosHelpers () { | |||
94 | }, | 94 | }, |
95 | 95 | ||
96 | getFiles: async (id: number | string) => { | 96 | getFiles: async (id: number | string) => { |
97 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id) | 97 | const video = await VideoModel.loadFull(id) |
98 | if (!video) return undefined | 98 | if (!video) return undefined |
99 | 99 | ||
100 | const webtorrentVideoFiles = (video.VideoFiles || []).map(f => ({ | 100 | const webtorrentVideoFiles = (video.VideoFiles || []).map(f => ({ |
@@ -178,14 +178,14 @@ function buildModerationHelpers () { | |||
178 | }, | 178 | }, |
179 | 179 | ||
180 | blacklistVideo: async (options: { videoIdOrUUID: number | string, createOptions: VideoBlacklistCreate }) => { | 180 | blacklistVideo: async (options: { videoIdOrUUID: number | string, createOptions: VideoBlacklistCreate }) => { |
181 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.videoIdOrUUID) | 181 | const video = await VideoModel.loadFull(options.videoIdOrUUID) |
182 | if (!video) return | 182 | if (!video) return |
183 | 183 | ||
184 | await blacklistVideo(video, options.createOptions) | 184 | await blacklistVideo(video, options.createOptions) |
185 | }, | 185 | }, |
186 | 186 | ||
187 | unblacklistVideo: async (options: { videoIdOrUUID: number | string }) => { | 187 | unblacklistVideo: async (options: { videoIdOrUUID: number | string }) => { |
188 | const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.videoIdOrUUID) | 188 | const video = await VideoModel.loadFull(options.videoIdOrUUID) |
189 | if (!video) return | 189 | if (!video) return |
190 | 190 | ||
191 | const videoBlacklist = await VideoBlacklistModel.loadByVideoId(video.id) | 191 | const videoBlacklist = await VideoBlacklistModel.loadByVideoId(video.id) |