]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/redundancy/video-redundancy.ts
Fix redundancy tests
[github/Chocobozzz/PeerTube.git] / server / models / redundancy / video-redundancy.ts
index 8621a5c6c1f83e23866caa63adbbf757659594fb..3df1c4f9cf1fa76977ef7ac942ca444df353b6a9 100644 (file)
@@ -237,6 +237,8 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
 
   static async getVideoSample (p: Bluebird<VideoModel[]>) {
     const rows = await p
+    if (rows.length === 0) return undefined
+
     const ids = rows.map(r => r.id)
     const id = sample(ids)
 
@@ -347,6 +349,7 @@ export class VideoRedundancyModel extends Model<VideoRedundancyModel> {
           required: true,
           include: [
             {
+              required: true,
               attributes: [],
               model: VideoStreamingPlaylistModel.unscoped(),
               include: [