Update generate.js
This commit is contained in:
parent
a9e58e0ee3
commit
a4aa6e7d1e
|
@ -33,7 +33,12 @@ async function loadStreams() {
|
|||
await db.streams.load()
|
||||
let streams = await db.streams.find({})
|
||||
streams = _.filter(streams, stream => stream.status !== 'error')
|
||||
streams = orderBy(streams, ['channel', 'height', 'url'], ['asc', 'desc', 'asc'])
|
||||
const levels = { online: 1, blocked: 2, timeout: 3, error: 4, default: 5 }
|
||||
streams = orderBy(
|
||||
streams,
|
||||
['channel', s => levels[s.status] || levels['default'], 'height', 'url'],
|
||||
['asc', 'asc', 'desc', 'asc']
|
||||
)
|
||||
streams = _.uniqBy(streams, stream => stream.channel || _.uniqueId())
|
||||
|
||||
await api.channels.load()
|
||||
|
|
Loading…
Reference in New Issue