Update playlist/generate.js
This commit is contained in:
parent
e2046899e9
commit
90aaf7f1c7
|
@ -32,9 +32,9 @@ main()
|
||||||
async function loadStreams() {
|
async function loadStreams() {
|
||||||
await db.streams.load()
|
await db.streams.load()
|
||||||
let streams = await db.streams.find({ is_broken: false })
|
let streams = await db.streams.find({ is_broken: false })
|
||||||
streams = _.orderBy(
|
streams = orderBy(
|
||||||
streams,
|
streams,
|
||||||
['channel_name', 'status.level', 'resolution.height', 'url'],
|
['channel_name', i => i.status.level, i => i.resolution.height, 'url'],
|
||||||
['asc', 'asc', 'desc', 'asc']
|
['asc', 'asc', 'desc', 'asc']
|
||||||
)
|
)
|
||||||
streams = _.uniqBy(streams, stream => stream.channel_id || _.uniqueId())
|
streams = _.uniqBy(streams, stream => stream.channel_id || _.uniqueId())
|
||||||
|
|
|
@ -6,12 +6,12 @@ const glob = require('glob')
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fs.emptyDirSync('tests/__data__/output')
|
fs.emptyDirSync('tests/__data__/output')
|
||||||
fs.copyFileSync(
|
fs.copyFileSync(
|
||||||
'tests/__data__/input/database/playlist-generate.streams.db',
|
'tests/__data__/input/database/playlist_generate.streams.db',
|
||||||
'tests/__data__/output/streams.db'
|
'tests/__data__/output/streams.db'
|
||||||
)
|
)
|
||||||
|
|
||||||
const stdout = execSync(
|
const stdout = execSync(
|
||||||
'DB_DIR=tests/__data__/output DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output/.gh-pages LOGS_DIR=tests/__data__/output/logs/generators node --trace-warnings scripts/commands/playlist/generate.js',
|
'DB_DIR=tests/__data__/output DATA_DIR=tests/__data__/input/data PUBLIC_DIR=tests/__data__/output/.gh-pages LOGS_DIR=tests/__data__/output/logs/generators npm run playlist:generate',
|
||||||
{ encoding: 'utf8' }
|
{ encoding: 'utf8' }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue