diff options
author | Chocobozzz <me@florianbigard.com> | 2022-06-28 14:57:51 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-06-28 15:06:15 +0200 |
commit | 4fae2b1f300c1f027629569817262f60873a663a (patch) | |
tree | fabffae6d39aa13b19985f8c92730db2a721dceb /server/lib/plugins/plugin-helpers-builder.ts | |
parent | 4c8336af67bf4e570e227d5cb1fbcb7a53b3776e (diff) | |
download | PeerTube-4fae2b1f300c1f027629569817262f60873a663a.tar.gz PeerTube-4fae2b1f300c1f027629569817262f60873a663a.tar.zst PeerTube-4fae2b1f300c1f027629569817262f60873a663a.zip |
Rename video full loading
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) |