Update playlist/generate.js

This commit is contained in:
Aleksandr Statciuk 2022-02-14 02:21:54 +03:00
parent d3f6b824bd
commit 76f18168c4
2 changed files with 3 additions and 1 deletions

View file

@ -31,7 +31,8 @@ main()
async function loadStreams() {
await db.streams.load()
let streams = await db.streams.find({ status: { $in: ['online', 'timeout', 'blocked'] } })
let streams = await db.streams.find({})
streams = _.filter(streams, stream => stream.status !== 'error')
streams = orderBy(streams, ['channel', 'height', 'url'], ['asc', 'desc', 'asc'])
streams = _.uniqBy(streams, stream => stream.channel || _.uniqueId())