X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=server%2Fmodels%2Fredundancy%2Fvideo-redundancy.ts;h=3df1c4f9cf1fa76977ef7ac942ca444df353b6a9;hb=9e3e3617dcea3e31dea60c4d41c9927da98cd560;hp=8621a5c6c1f83e23866caa63adbbf757659594fb;hpb=fb1b0ed9f709ef519d0f52bcb2048c10a8c8cfc0;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/redundancy/video-redundancy.ts b/server/models/redundancy/video-redundancy.ts index 8621a5c6c..3df1c4f9c 100644 --- a/server/models/redundancy/video-redundancy.ts +++ b/server/models/redundancy/video-redundancy.ts @@ -237,6 +237,8 @@ export class VideoRedundancyModel extends Model { static async getVideoSample (p: Bluebird) { 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 { required: true, include: [ { + required: true, attributes: [], model: VideoStreamingPlaylistModel.unscoped(), include: [