mirror of
https://github.com/iptv-org/iptv.git
synced 2024-09-08 00:00:27 +02:00
17 lines
418 B
JavaScript
17 lines
418 B
JavaScript
const { logger, db } = require('../../core')
|
|
|
|
async function main() {
|
|
await db.streams.load()
|
|
const docs = await db.streams.find({}).sort({ cluster_id: 1 })
|
|
const cluster_id = docs.reduce((acc, curr) => {
|
|
if (!acc.includes(curr.cluster_id)) acc.push(curr.cluster_id)
|
|
return acc
|
|
}, [])
|
|
|
|
const matrix = { cluster_id }
|
|
const output = `MATRIX=${JSON.stringify(matrix)}`
|
|
logger.info(output)
|
|
}
|
|
|
|
main()
|