Update playlist/update.js

This commit is contained in:
Aleksandr Statciuk 2022-02-13 07:23:40 +03:00
parent a7b02697ab
commit 395f40013a
2 changed files with 7 additions and 11 deletions

View file

@ -6,11 +6,7 @@ const _ = require('lodash')
async function main() {
await db.streams.load()
let streams = await db.streams.find({})
streams = orderBy(
streams,
['channel_name', i => i.status.level, i => i.resolution.height, 'url'],
['asc', 'asc', 'desc', 'asc']
)
streams = orderBy(streams, ['title', 'height', 'url'], ['asc', 'desc', 'asc'])
const files = _.groupBy(streams, 'filepath')
for (const filepath in files) {