]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Rename video full loading
authorChocobozzz <me@florianbigard.com>
Tue, 28 Jun 2022 12:57:51 +0000 (14:57 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 28 Jun 2022 13:06:15 +0000 (15:06 +0200)
31 files changed:
scripts/create-move-video-storage-job.ts
scripts/create-transcoding-job.ts
scripts/migrations/peertube-4.0.ts
scripts/update-host.ts
server/controllers/api/videos/ownership.ts
server/controllers/api/videos/update.ts
server/controllers/api/videos/upload.ts
server/lib/activitypub/process/process-dislike.ts
server/lib/activitypub/process/process-like.ts
server/lib/activitypub/process/process-undo.ts
server/lib/activitypub/send/send-undo.ts
server/lib/activitypub/send/send-update.ts
server/lib/files-cache/videos-caption-cache.ts
server/lib/files-cache/videos-preview-cache.ts
server/lib/files-cache/videos-torrent-cache.ts
server/lib/job-queue/handlers/activitypub-http-fetcher.ts
server/lib/job-queue/handlers/video-file-import.ts
server/lib/job-queue/handlers/video-import.ts
server/lib/job-queue/handlers/video-live-ending.ts
server/lib/job-queue/handlers/video-studio-edition.ts
server/lib/job-queue/handlers/video-transcoding.ts
server/lib/live/live-manager.ts
server/lib/model-loaders/video.ts
server/lib/plugins/plugin-helpers-builder.ts
server/lib/schedulers/update-videos-scheduler.ts
server/lib/schedulers/video-views-buffer-scheduler.ts
server/lib/video-channel.ts
server/lib/video-state.ts
server/middlewares/validators/shared/videos.ts
server/models/video/sql/video/video-model-get-query-builder.ts
server/models/video/video.ts

index 18629aa27dad54f94a963a7866657542f067220e..0f0d4ee35f770bad129067ac525a59d864aa4d05 100644 (file)
@@ -70,7 +70,7 @@ async function run () {
   }
 
   for (const id of ids) {
-    const videoFull = await VideoModel.loadAndPopulateAccountAndServerAndTags(id)
+    const videoFull = await VideoModel.loadFull(id)
 
     const files = videoFull.VideoFiles || []
     const hls = videoFull.getHLSPlaylist()
index 59fc84ad59e6723ea4ca056d9590c307d1415b31..8f4d64290f1793cb28c329ed1e859f72a79b0db3 100755 (executable)
@@ -43,7 +43,7 @@ async function run () {
     return
   }
 
-  const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(uuid)
+  const video = await VideoModel.loadFull(uuid)
   if (!video) throw new Error('Video not found.')
 
   const dataInput: VideoTranscodingPayload[] = []
index 64cf4547435b011d090afd6ba573c26bf8d25515..9e5ca60d40b580bf752e44859221fcf5f193a775 100644 (file)
@@ -97,7 +97,7 @@ async function processVideo (videoId: number) {
   // Everything worked, we can save the playlist now
   await playlist.save()
 
-  const allVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.id)
+  const allVideo = await VideoModel.loadFull(video.id)
   await federateVideoIfNeeded(allVideo, false)
 
   console.log(`Successfully moved HLS files of ${video.name}.`)
index bb54290a45c410a24c6bd3f1f7b0fe96d49dff34..1d17ce1521d38783071400d03e94df738d67db09 100755 (executable)
@@ -114,7 +114,7 @@ async function run () {
 
   const ids = await VideoModel.listLocalIds()
   for (const id of ids) {
-    const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(id)
+    const video = await VideoModel.loadFull(id)
 
     console.log('Updating video ' + video.uuid)
 
index 043861ac3cea13ddf0add36a360bb288db064561..88355b289501e3a7434958d4c449511d0a420128 100644 (file)
@@ -105,7 +105,7 @@ function acceptOwnership (req: express.Request, res: express.Response) {
     const channel = res.locals.videoChannel
 
     // We need more attributes for federation
-    const targetVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoChangeOwnership.Video.id, t)
+    const targetVideo = await VideoModel.loadFull(videoChangeOwnership.Video.id, t)
 
     const oldVideoChannel = await VideoChannelModel.loadAndPopulateAccount(targetVideo.channelId, t)
 
index 2cf8a5883ecf25e0dbf6e34d8295ca8bd335665d..65a7321fd22d5c9e0ee192f55585633bd20496ea 100644 (file)
@@ -62,7 +62,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
   try {
     const { videoInstanceUpdated, isNewVideo } = await sequelizeTypescript.transaction(async t => {
       // Refresh video since thumbnails to prevent concurrent updates
-      const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoFromReq.id, t)
+      const video = await VideoModel.loadFull(videoFromReq.id, t)
 
       const sequelizeOptions = { transaction: t }
       const oldVideoChannel = video.VideoChannel
@@ -212,5 +212,5 @@ async function updateTorrentsMetadataIfNeeded (video: MVideoFullLight, videoInfo
   }
 
   // Refresh video since files have changed
-  return VideoModel.loadAndPopulateAccountAndServerAndTags(video.id)
+  return VideoModel.loadFull(video.id)
 }
index c5890691e9062f1e41b908c3046997ea5824a3f7..3ce66c9cad11327c4258aa8438503afadc0dc890 100644 (file)
@@ -272,7 +272,7 @@ async function createTorrentFederate (video: MVideoFullLight, videoFile: MVideoF
   const job = await JobQueue.Instance.createJobWithPromise({ type: 'manage-video-torrent', payload })
   await job.finished()
 
-  const refreshedVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.id)
+  const refreshedVideo = await VideoModel.loadFull(video.id)
   if (!refreshedVideo) return
 
   // Only federate and notify after the torrent creation
index 97a994e945c3406dbed9f9e07962530d5e9f895b..44e349b22cc2c7a460dd18833a8640b31d02e2f5 100644 (file)
@@ -35,7 +35,7 @@ async function processDislike (activity: ActivityCreate | ActivityDislike, byAct
   if (!onlyVideo.isOwned()) return
 
   return sequelizeTypescript.transaction(async t => {
-    const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(onlyVideo.id, t)
+    const video = await VideoModel.loadFull(onlyVideo.id, t)
 
     const existingRate = await AccountVideoRateModel.loadByAccountAndVideoOrUrl(byAccount.id, video.id, activity.id, t)
     if (existingRate && existingRate.type === 'dislike') return
index 1aee756d86d32b5d93b58dabfc30db8b7676ff6c..580a05bcdd770a85f5819047a5df73a8a678f603 100644 (file)
@@ -34,7 +34,7 @@ async function processLikeVideo (byActor: MActorSignature, activity: ActivityLik
   if (!onlyVideo.isOwned()) return
 
   return sequelizeTypescript.transaction(async t => {
-    const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(onlyVideo.id, t)
+    const video = await VideoModel.loadFull(onlyVideo.id, t)
 
     const existingRate = await AccountVideoRateModel.loadByAccountAndVideoOrUrl(byAccount.id, video.id, activity.id, t)
     if (existingRate && existingRate.type === 'like') return
index 257eb6c2b5e722d167d39b573cada405c8239f6a..778a38e05fba2aeffa24f0722e04d4fdf4ed25cd 100644 (file)
@@ -63,7 +63,7 @@ async function processUndoLike (byActor: MActorSignature, activity: ActivityUndo
   return sequelizeTypescript.transaction(async t => {
     if (!byActor.Account) throw new Error('Unknown account ' + byActor.url)
 
-    const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(onlyVideo.id, t)
+    const video = await VideoModel.loadFull(onlyVideo.id, t)
     const rate = await AccountVideoRateModel.loadByAccountAndVideoOrUrl(byActor.Account.id, video.id, likeActivity.id, t)
     if (!rate || rate.type !== 'like') throw new Error(`Unknown like by account ${byActor.Account.id} for video ${video.id}.`)
 
@@ -87,7 +87,7 @@ async function processUndoDislike (byActor: MActorSignature, activity: ActivityU
   return sequelizeTypescript.transaction(async t => {
     if (!byActor.Account) throw new Error('Unknown account ' + byActor.url)
 
-    const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(onlyVideo.id, t)
+    const video = await VideoModel.loadFull(onlyVideo.id, t)
     const rate = await AccountVideoRateModel.loadByAccountAndVideoOrUrl(byActor.Account.id, video.id, dislike.id, t)
     if (!rate || rate.type !== 'dislike') throw new Error(`Unknown dislike by account ${byActor.Account.id} for video ${video.id}.`)
 
index 442178c420461922206317c5ceee7e9b521a3aaa..b8eb47ff6896516171d4736a76f2a72ca50a787d 100644 (file)
@@ -83,7 +83,7 @@ async function sendUndoCacheFile (byActor: MActor, redundancyModel: MVideoRedund
     return
   }
 
-  const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(associatedVideo.id)
+  const video = await VideoModel.loadFull(associatedVideo.id)
   const createActivity = buildCreateActivity(redundancyModel.url, byActor, redundancyModel.toActivityPubObject())
 
   return sendUndoVideoRelatedActivity({
index 3577ece02c5710232bf352bab0ff10ec0842e722..24983dd199d8aad5f00d60e3be5cde10525e93d3 100644 (file)
@@ -92,7 +92,7 @@ async function sendUpdateCacheFile (byActor: MActorLight, redundancyModel: MVide
     return
   }
 
-  const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(associatedVideo.id)
+  const video = await VideoModel.loadFull(associatedVideo.id)
 
   const activityBuilder = (audience: ActivityAudience) => {
     const redundancyObject = redundancyModel.toActivityPubObject()
index 58e2260b63bff999749ffe75b4fe6bc80a1a01e5..2927c37eb04238d1a451f8a3f01642f7ace25d45 100644 (file)
@@ -35,7 +35,7 @@ class VideosCaptionCache extends AbstractVideoStaticFileCache <string> {
     if (videoCaption.isOwned()) throw new Error('Cannot load remote caption of owned video.')
 
     // Used to fetch the path
-    const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoCaption.videoId)
+    const video = await VideoModel.loadFull(videoCaption.videoId)
     if (!video) return undefined
 
     const remoteUrl = videoCaption.getFileUrl(video)
index dd3a84aca60a7c8fe5d0dbf7c6a3676bea57d3aa..b7a8d610562bfb2d14e7e9ee9bf4c00d774e28e8 100644 (file)
@@ -30,7 +30,7 @@ class VideosPreviewCache extends AbstractVideoStaticFileCache <string> {
 
   // Key is the video UUID
   protected async loadRemoteFile (key: string) {
-    const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(key)
+    const video = await VideoModel.loadFull(key)
     if (!video) return undefined
 
     if (video.isOwned()) throw new Error('Cannot load remote preview of owned video.')
index 23217f1403119acfdb1f5b943c51f73260eb0fd4..c8188b79fddcf622c88d4f978663523a8618e09c 100644 (file)
@@ -40,7 +40,7 @@ class VideosTorrentCache extends AbstractVideoStaticFileCache <string> {
     if (file.getVideo().isOwned()) throw new Error('Cannot load remote file of owned video.')
 
     // Used to fetch the path
-    const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(file.getVideo().id)
+    const video = await VideoModel.loadFull(file.getVideo().id)
     if (!video) return undefined
 
     const remoteUrl = file.getRemoteTorrentUrl(video)
index 128e14f949c405ae048032f2be7e45fdef56f238..de533de6c5ef7ce40c07161447b6416410c2e67e 100644 (file)
@@ -17,7 +17,7 @@ async function processActivityPubHttpFetcher (job: Job) {
   const payload = job.data as ActivitypubHttpFetcherPayload
 
   let video: MVideoFullLight
-  if (payload.videoId) video = await VideoModel.loadAndPopulateAccountAndServerAndTags(payload.videoId)
+  if (payload.videoId) video = await VideoModel.loadFull(payload.videoId)
 
   const fetcherType: { [ id in FetchType ]: (items: any[]) => Promise<any> } = {
     'activity': items => processActivities(items, { outboxUrl: payload.uri, fromFetch: true }),
index 110176d81f89d76df36e09f648b96ed0a9aa6e42..1c600e2a732f195ce0884a02d4f44f6de3137ae1 100644 (file)
@@ -18,7 +18,7 @@ async function processVideoFileImport (job: Job) {
   const payload = job.data as VideoFileImportPayload
   logger.info('Processing video file import in job %d.', job.id)
 
-  const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(payload.videoUUID)
+  const video = await VideoModel.loadFull(payload.videoUUID)
   // No video, maybe deleted?
   if (!video) {
     logger.info('Do not process job %d, video does not exist.', job.id)
index d59a1b12f6a6f5041c038017051d0b1bfb1ac438..40804e82e516db087834e8fa71800ce5804a33f3 100644 (file)
@@ -219,7 +219,7 @@ async function processFile (downloader: () => Promise<string>, videoImport: MVid
         if (previewModel) await video.addAndSaveThumbnail(previewModel, t)
 
         // Now we can federate the video (reload from database, we need more attributes)
-        const videoForFederation = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.uuid, t)
+        const videoForFederation = await VideoModel.loadFull(video.uuid, t)
         await federateVideoIfNeeded(videoForFederation, true, t)
 
         // Update video import object
index b2c42664a57c10b3913d5eb16207ca908169194a..0e1bfb240fe835c787a01c8d60c2a28c8158d97d 100644 (file)
@@ -144,7 +144,7 @@ async function replaceLiveByReplay (options: {
   await liveSession.save()
 
   // Remove old HLS playlist video files
-  const videoWithFiles = await VideoModel.loadAndPopulateAccountAndServerAndTags(liveVideo.id)
+  const videoWithFiles = await VideoModel.loadFull(liveVideo.id)
 
   const hlsPlaylist = videoWithFiles.getHLSPlaylist()
   await VideoFileModel.removeHLSFilesOfVideoId(hlsPlaylist.id)
@@ -241,7 +241,7 @@ async function cleanupLiveAndFederate (options: {
   }
 
   try {
-    const fullVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.id)
+    const fullVideo = await VideoModel.loadFull(video.id)
     return federateVideoIfNeeded(fullVideo, false, undefined)
   } catch (err) {
     logger.warn('Cannot federate live after cleanup', { videoId: video.id, err })
index cf3064a7ace5e5c8e34e2611dccbf07edb554214..434d0ffe821d1e9430c7020b102ac6488dca12e4 100644 (file)
@@ -44,7 +44,7 @@ async function processVideoStudioEdition (job: Job) {
 
   logger.info('Process video studio edition of %s in job %d.', payload.videoUUID, job.id, lTags)
 
-  const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(payload.videoUUID)
+  const video = await VideoModel.loadFull(payload.videoUUID)
 
   // No video, maybe deleted?
   if (!video) {
index 95ee6b384d9902f50a4ca39738e78c3a6b2dfe1f..5afca65cab154fa62be86e5f2a0eb8a18a111d85 100644 (file)
@@ -42,7 +42,7 @@ async function processVideoTranscoding (job: Job) {
   const payload = job.data as VideoTranscodingPayload
   logger.info('Processing transcoding job %d.', job.id, lTags(payload.videoUUID))
 
-  const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(payload.videoUUID)
+  const video = await VideoModel.loadFull(payload.videoUUID)
   // No video, maybe deleted?
   if (!video) {
     logger.info('Do not process job %d, video does not exist.', job.id, lTags(payload.videoUUID))
@@ -180,7 +180,7 @@ async function onVideoFirstWebTorrentTranscoding (
   const { resolution, isPortraitMode, audioStream } = await videoArg.probeMaxQualityFile()
 
   // Maybe the video changed in database, refresh it
-  const videoDatabase = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoArg.uuid)
+  const videoDatabase = await VideoModel.loadFull(videoArg.uuid)
   // Video does not exist anymore
   if (!videoDatabase) return undefined
 
index d499b4b1af3e245d593fc4af21cb3fa5ab7aa928..74f2030910574798ddb6c92e84bac2744333e092 100644 (file)
@@ -351,7 +351,7 @@ class LiveManager {
     const videoId = live.videoId
 
     try {
-      const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
+      const video = await VideoModel.loadFull(videoId)
 
       logger.info('Will publish and federate live %s.', video.url, localLTags)
 
@@ -390,7 +390,7 @@ class LiveManager {
     const { videoId, liveSession: liveSessionArg, cleanupNow = false } = options
 
     try {
-      const fullVideo = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
+      const fullVideo = await VideoModel.loadFull(videoId)
       if (!fullVideo) return
 
       const live = await VideoLiveModel.loadByVideoId(fullVideo.id)
index 0a3c15ad83ac326cd60ae0b6abbc243225944046..cef6a367c1c05e960cdeac0db4bd9a7a72facadd 100644 (file)
@@ -35,7 +35,7 @@ function loadVideo (
     )
   }
 
-  if (fetchType === 'all') return VideoModel.loadAndPopulateAccountAndServerAndTags(id, undefined, userId)
+  if (fetchType === 'all') return VideoModel.loadFull(id, undefined, userId)
 
   if (fetchType === 'only-immutable-attributes') return VideoModel.loadImmutableAttributes(id)
 
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)
index c652682dd6a7f4b19a584856dc040e90e2b1ae77..5bfbc3cd259346859454007f33bfc4c4e4280881 100644 (file)
@@ -30,7 +30,7 @@ export class UpdateVideosScheduler extends AbstractScheduler {
 
     for (const schedule of schedules) {
       await sequelizeTypescript.transaction(async t => {
-        const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(schedule.videoId, t)
+        const video = await VideoModel.loadFull(schedule.videoId, t)
 
         logger.info('Executing scheduled video update on %s.', video.uuid)
 
index 937764155816f82fd6f76f34228517dca9acafb3..244a88b14ce087d92cad187278d201761861857f 100644 (file)
@@ -26,7 +26,7 @@ export class VideoViewsBufferScheduler extends AbstractScheduler {
         const views = await Redis.Instance.getLocalVideoViews(videoId)
         await Redis.Instance.deleteLocalVideoViews(videoId)
 
-        const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
+        const video = await VideoModel.loadFull(videoId)
         if (!video) {
           logger.debug('Video %d does not exist anymore, skipping videos view addition.', videoId, lTags())
           continue
index 2fd63a8c4cfdac8e40f1435c4d4ec0f55264174f..8322c9ad2a6808c9ed0f8ed0955c1797a0d18e84 100644 (file)
@@ -36,7 +36,7 @@ async function federateAllVideosOfChannel (videoChannel: MChannelId) {
   const videoIds = await VideoModel.getAllIdsFromChannel(videoChannel)
 
   for (const videoId of videoIds) {
-    const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
+    const video = await VideoModel.loadFull(videoId)
 
     await federateVideoIfNeeded(video, false)
   }
index ae2725d650c6f2c90a7d6cdacc3133fe6642786f..b4e3831e5d4c03b89c1b554eb2f41ce53295300a 100644 (file)
@@ -43,7 +43,7 @@ function moveToNextState (options: {
 
   return sequelizeTypescript.transaction(async t => {
     // Maybe the video changed in database, refresh it
-    const videoDatabase = await VideoModel.loadAndPopulateAccountAndServerAndTags(video.uuid, t)
+    const videoDatabase = await VideoModel.loadFull(video.uuid, t)
     // Video does not exist anymore
     if (!videoDatabase) return undefined
 
index 2c2ae381127f4294e3b42ef24cd5bff2f6b3d654..e3a98c58f9d85640bfc4b9cb3c500a3e3cde81ee 100644 (file)
@@ -144,7 +144,7 @@ async function checkCanSeeAuthVideo (req: Request, res: Response, video: MVideoI
 
   const videoWithRights = (video as MVideoWithRights).VideoChannel?.Account?.userId
     ? video as MVideoWithRights
-    : await VideoModel.loadAndPopulateAccountAndServerAndTags(video.id)
+    : await VideoModel.loadFull(video.id)
 
   const privacy = videoWithRights.privacy
 
index 32e5c4ff70bad988a51be9b9ac59980e26498fe6..29e59c8be8fc9817fa9b7ef892578f0fc4e984ee 100644 (file)
@@ -13,7 +13,7 @@ import { VideoTableAttributes } from './shared/video-table-attributes'
 
 export type GetType =
   'api' |
-  'full-light' |
+  'full' |
   'account-blacklist-files' |
   'all-files' |
   'thumbnails' |
@@ -40,7 +40,7 @@ export class VideoModelGetQueryBuilder {
 
   private readonly videoModelBuilder: VideoModelBuilder
 
-  private static readonly videoFilesInclude = new Set<GetType>([ 'api', 'full-light', 'account-blacklist-files', 'all-files' ])
+  private static readonly videoFilesInclude = new Set<GetType>([ 'api', 'full', 'account-blacklist-files', 'all-files' ])
 
   constructor (protected readonly sequelize: Sequelize) {
     this.videoQueryBuilder = new VideosModelGetQuerySubBuilder(sequelize)
@@ -96,16 +96,16 @@ export class VideosModelGetQuerySubBuilder extends AbstractVideoQueryBuilder {
   protected streamingPlaylistFilesQuery: string
 
   private static readonly trackersInclude = new Set<GetType>([ 'api' ])
-  private static readonly liveInclude = new Set<GetType>([ 'api', 'full-light' ])
-  private static readonly scheduleUpdateInclude = new Set<GetType>([ 'api', 'full-light' ])
-  private static readonly tagsInclude = new Set<GetType>([ 'api', 'full-light' ])
-  private static readonly userHistoryInclude = new Set<GetType>([ 'api', 'full-light' ])
-  private static readonly accountInclude = new Set<GetType>([ 'api', 'full-light', 'account-blacklist-files' ])
+  private static readonly liveInclude = new Set<GetType>([ 'api', 'full' ])
+  private static readonly scheduleUpdateInclude = new Set<GetType>([ 'api', 'full' ])
+  private static readonly tagsInclude = new Set<GetType>([ 'api', 'full' ])
+  private static readonly userHistoryInclude = new Set<GetType>([ 'api', 'full' ])
+  private static readonly accountInclude = new Set<GetType>([ 'api', 'full', 'account-blacklist-files' ])
   private static readonly ownerUserInclude = new Set<GetType>([ 'blacklist-rights' ])
 
   private static readonly blacklistedInclude = new Set<GetType>([
     'api',
-    'full-light',
+    'full',
     'account-blacklist-files',
     'thumbnails-blacklist',
     'blacklist-rights'
@@ -113,7 +113,7 @@ export class VideosModelGetQuerySubBuilder extends AbstractVideoQueryBuilder {
 
   private static readonly thumbnailsInclude = new Set<GetType>([
     'api',
-    'full-light',
+    'full',
     'account-blacklist-files',
     'all-files',
     'thumbnails',
index 08adbced6c31ed9db7014d76e8ce72eb31a15360..e5f8b5fa297dae31c15f39e3e83e891353cdbaf6 100644 (file)
@@ -1352,10 +1352,10 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
     return queryBuilder.queryVideo({ url, transaction, type: 'account-blacklist-files' })
   }
 
-  static loadAndPopulateAccountAndServerAndTags (id: number | string, t?: Transaction, userId?: number): Promise<MVideoFullLight> {
+  static loadFull (id: number | string, t?: Transaction, userId?: number): Promise<MVideoFullLight> {
     const queryBuilder = new VideoModelGetQueryBuilder(VideoModel.sequelize)
 
-    return queryBuilder.queryVideo({ id, transaction: t, type: 'full-light', userId })
+    return queryBuilder.queryVideo({ id, transaction: t, type: 'full', userId })
   }
 
   static loadForGetAPI (parameters: {