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)
required: true,
include: [
{
+ required: true,
attributes: [],
model: VideoStreamingPlaylistModel.unscoped(),
include: [
immutableAssign({
min_lifetime: '1 hour',
strategy: strategy,
- size: '200KB'
+ size: '400KB'
}, additionalParams)
]
}
const stat = data.videosRedundancy[0]
expect(stat.strategy).to.equal(strategy)
- expect(stat.totalSize).to.equal(204800)
- expect(stat.totalUsed).to.be.at.least(1).and.below(204801)
+ expect(stat.totalSize).to.equal(409600)
+ expect(stat.totalUsed).to.be.at.least(1).and.below(409601)
expect(stat.totalVideoFiles).to.equal(4)
expect(stat.totalVideos).to.equal(1)
}
const stat = data.videosRedundancy[0]
expect(stat.strategy).to.equal(strategy)
- expect(stat.totalSize).to.equal(204800)
+ expect(stat.totalSize).to.equal(409600)
expect(stat.totalUsed).to.equal(0)
expect(stat.totalVideoFiles).to.equal(0)
expect(stat.totalVideos).to.equal(0)