diff --git a/scripts/commands/create-matrix.js b/scripts/commands/create-matrix.js index 5abe8a9c..98780ada 100644 --- a/scripts/commands/create-matrix.js +++ b/scripts/commands/create-matrix.js @@ -1,8 +1,8 @@ const { logger, db } = require('../core') async function main() { - await db.channels.load() - const docs = await db.channels.find({}).sort({ cluster_id: 1 }) + await db.queue.load() + const docs = await db.queue.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 diff --git a/tests/__data__/input/database/channels.db b/tests/__data__/input/database/channels.db deleted file mode 100644 index aae9e3ed..00000000 --- a/tests/__data__/input/database/channels.db +++ /dev/null @@ -1,4 +0,0 @@ -{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","name":"Bravo East","site":"directv.com","channelsPath":"sites/directv.com/directv.com_us.channels.xml","configPath":"sites/directv.com/directv.com.config.js","groups":["us/directv.com"],"cluster_id":84,"country":"US","programCount":0,"_id":"00AluKCrCnfgrl8W"} -{"lang":"fr","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"53","logo":null,"name":"CNN International Europe","site":"chaines-tv.orange.fr","channelsPath":"sites/chaines-tv.orange.fr/chaines-tv.orange.fr_fr.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr/chaines-tv.orange.fr", "bh/chaines-tv.orange.fr"],"cluster_id":1,"programCount":32,"_id":"0Wefq0oMR3feCcuY"} -{"lang":"ru","country":"US","xmltv_id":"CNNInternationalEurope.us","site_id":"140","logo":"https://www.magticom.ge/images/channels/MjAxOC8wOS8xMC9lZmJhNWU5Yy0yMmNiLTRkMTAtOWY5Ny01ODM0MzY0ZTg0MmEuanBn.jpg","name":"CNN Int","site":"magticom.ge","channelsPath":"sites/magticom.ge/magticom.ge_ge.channels.xml","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ge/magticom.ge"],"cluster_id":1,"programCount":0,"_id":"1XzrxNkSF2AQNBrT"} -{"lang":"en","country":"ZA","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","logo":"https://rndcdn.dstv.com/dstvcms/2020/08/31/M-Net_Movies_2_Logo_4-3_lightbackground_xlrg.png","name":"M-Net Movies 2","site":"dstv.com","channelsPath":"sites/dstv.com/dstv.com_zw.channels.xml","configPath":"sites/dstv.com/dstv.com.config.js","groups":["zw/dstv.com"],"cluster_id":120,"programCount":14,"_id":"1lnhXpN7g0ER5XwN"} diff --git a/tests/__data__/input/database/queue.db b/tests/__data__/input/database/queue.db new file mode 100644 index 00000000..87a22b74 --- /dev/null +++ b/tests/__data__/input/database/queue.db @@ -0,0 +1,4 @@ +{"lang":"en","xmltv_id":"BravoEast.us","site_id":"237","site":"directv.com","configPath":"sites/directv.com/directv.com.config.js","groups":["us/directv.com"],"cluster_id":84,"programCount":0,"_id":"00AluKCrCnfgrl8W"} +{"lang":"fr","xmltv_id":"CNNInternationalEurope.us","site_id":"53","site":"chaines-tv.orange.fr","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["fr/chaines-tv.orange.fr", "bh/chaines-tv.orange.fr"],"cluster_id":1,"programCount":32,"_id":"0Wefq0oMR3feCcuY"} +{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140","site":"magticom.ge","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ge/magticom.ge"],"cluster_id":1,"programCount":0,"_id":"1XzrxNkSF2AQNBrT"} +{"lang":"en","xmltv_id":"MNetMovies2.za","site_id":"404a052b-3dea-4cac-a19c-de9a7d6f191d#MAP","site":"dstv.com","configPath":"sites/dstv.com/dstv.com.config.js","groups":["zw/dstv.com"],"cluster_id":120,"programCount":14,"_id":"1lnhXpN7g0ER5XwN"} diff --git a/tests/commands/create-matrix.test.js b/tests/commands/create-matrix.test.js index ee0a1319..c30f39ca 100644 --- a/tests/commands/create-matrix.test.js +++ b/tests/commands/create-matrix.test.js @@ -6,10 +6,7 @@ beforeEach(() => { fs.rmdirSync('tests/__data__/output', { recursive: true }) fs.mkdirSync('tests/__data__/output') fs.mkdirSync('tests/__data__/temp/database', { recursive: true }) - fs.copyFileSync( - 'tests/__data__/input/database/channels.db', - 'tests/__data__/temp/database/channels.db' - ) + fs.copyFileSync('tests/__data__/input/database/queue.db', 'tests/__data__/temp/database/queue.db') }) afterEach(() => {