]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/plugins/plugin-helpers-builder.ts
Rename video full loading
[github/Chocobozzz/PeerTube.git] / server / lib / plugins / plugin-helpers-builder.ts
index 897271c0b416a751062e6c5fc29116d0acf255fa..b76c0a8a4894ba46bc0c3a6a00a9c1e6baa8e651 100644 (file)
@@ -83,7 +83,7 @@ function buildVideosHelpers () {
 
     removeVideo: (id: number) => {
       return sequelizeTypescript.transaction(async t => {
-        const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id, t)
+        const video = await VideoModel.loadFull(id, t)
 
         await video.destroy({ transaction: t })
       })
@@ -94,7 +94,7 @@ function buildVideosHelpers () {
     },
 
     getFiles: async (id: number | string) => {
-      const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id)
+      const video = await VideoModel.loadFull(id)
       if (!video) return undefined
 
       const webtorrentVideoFiles = (video.VideoFiles || []).map(f => ({
@@ -178,14 +178,14 @@ function buildModerationHelpers () {
     },
 
     blacklistVideo: async (options: { videoIdOrUUID: number | string, createOptions: VideoBlacklistCreate }) => {
-      const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.videoIdOrUUID)
+      const video = await VideoModel.loadFull(options.videoIdOrUUID)
       if (!video) return
 
       await blacklistVideo(video, options.createOptions)
     },
 
     unblacklistVideo: async (options: { videoIdOrUUID: number | string }) => {
-      const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(options.videoIdOrUUID)
+      const video = await VideoModel.loadFull(options.videoIdOrUUID)
       if (!video) return
 
       const videoBlacklist = await VideoBlacklistModel.loadByVideoId(video.id)