mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-12 10:00:05 -04:00
Update playlist/generate.js
This commit is contained in:
parent
0d1ab5dfe9
commit
081fcac929
17 changed files with 273 additions and 274 deletions
|
@ -1,4 +1,5 @@
|
|||
const { db, generator, api, logger, file } = require('../../core')
|
||||
const { orderBy } = require('natural-orderby')
|
||||
const _ = require('lodash')
|
||||
|
||||
async function main() {
|
||||
|
@ -31,6 +32,12 @@ main()
|
|||
async function loadStreams() {
|
||||
await db.streams.load()
|
||||
let streams = await db.streams.find({ is_broken: false })
|
||||
streams = _.orderBy(
|
||||
streams,
|
||||
['channel_name', 'status.level', 'resolution.height', 'url'],
|
||||
['asc', 'asc', 'desc', 'asc']
|
||||
)
|
||||
streams = _.uniqBy(streams, stream => stream.channel_id || _.uniqueId())
|
||||
|
||||
await api.channels.load()
|
||||
let channels = await api.channels.all()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue