Fix videos list for api SQL request
authorChocobozzz <me@florianbigard.com>
Wed, 13 Mar 2019 15:47:01 +0000 (16:47 +0100)
committerChocobozzz <chocobozzz@cpy.re>
Mon, 18 Mar 2019 10:17:59 +0000 (11:17 +0100)
server/models/video/video.ts

index 7624b064904c63e83c382ab6e487aec776fe727f..946be60958bdd4e11e29f324939c51e9f74624cf 100644 (file)
@@ -225,7 +225,8 @@ type AvailableForListIDsOptions = {
       },
       include: [
         {
-          model: VideoChannelModel.scope({ method: [ VideoChannelScopeNames.SUMMARY, true ] })
+          model: VideoChannelModel.scope({ method: [ VideoChannelScopeNames.SUMMARY, true ] }),
+          required: true
         }
       ]
     }
@@ -1566,8 +1567,8 @@ export class VideoModel extends Model<VideoModel> {
     apiScope.push({
       method: [
         ScopeNames.FOR_API, {
-          ids, withFiles:
-          options.withFiles,
+          ids,
+          withFiles: options.withFiles,
           videoPlaylistId: options.videoPlaylistId
         } as ForAPIOptions
       ]