From fa34132d1588fa03a17e8aa089e874418619aa21 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Mon, 31 Jan 2022 00:55:59 +0300 Subject: [PATCH] Update create-queue.js --- scripts/commands/create-queue.js | 11 ++++++----- tests/__data__/expected/database/queue.db | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/commands/create-queue.js b/scripts/commands/create-queue.js index 3f0076a0..318d8159 100644 --- a/scripts/commands/create-queue.js +++ b/scripts/commands/create-queue.js @@ -48,15 +48,16 @@ async function createQueue() { for (const d of dates) { const dString = d.toJSON() const key = `${item.site}:${item.site_id}:${dString}` - console.log(key) if (!queue[key]) { queue[key] = { - lang: item.lang, - xmltv_id: item.xmltv_id, - site_id: item.site_id, + channel: { + lang: item.lang, + xmltv_id: item.xmltv_id, + site_id: item.site_id + }, site: item.site, date: dString, - configPath: item.configPath, + configPath, groups: [], error: null } diff --git a/tests/__data__/expected/database/queue.db b/tests/__data__/expected/database/queue.db index a6163bb2..5285dde6 100644 --- a/tests/__data__/expected/database/queue.db +++ b/tests/__data__/expected/database/queue.db @@ -1,4 +1,4 @@ -{"lang":"en","xmltv_id":"CNNInternationalEurope2.us","site_id":"141","site":"example.com","date":"2022-01-30T00:00:00.000Z","groups":["ca-nl/example.com"],"error":null,"cluster_id":1,"_id":"c4pT2p7Q4aBVh13M"} -{"lang":"en","xmltv_id":"CNNInternationalEurope2.us","site_id":"141","site":"example.com","date":"2022-01-31T00:00:00.000Z","groups":["ca-nl/example.com"],"error":null,"cluster_id":1,"_id":"POYAcMssTAgZu4Yk"} -{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140","site":"example.com","date":"2022-01-30T00:00:00.000Z","groups":["ca-nl/example.com"],"error":null,"cluster_id":1,"_id":"TYDwYLsrkmPtTLT2"} -{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140","site":"example.com","date":"2022-01-31T00:00:00.000Z","groups":["ca-nl/example.com"],"error":null,"cluster_id":1,"_id":"98cKRthEhMmKEnwx"} +{"channel":{"lang":"en","xmltv_id":"CNNInternationalEurope2.us","site_id":"141"},"configPath":"tests/__data__/input/sites/example.com.config.js","site":"example.com","date":"2022-01-30T00:00:00.000Z","groups":["ca-nl/example.com"],"error":null,"cluster_id":1,"_id":"c4pT2p7Q4aBVh13M"} +{"channel":{"lang":"en","xmltv_id":"CNNInternationalEurope2.us","site_id":"141"},"configPath":"tests/__data__/input/sites/example.com.config.js","site":"example.com","date":"2022-01-31T00:00:00.000Z","groups":["ca-nl/example.com"],"error":null,"cluster_id":1,"_id":"POYAcMssTAgZu4Yk"} +{"channel":{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140"},"configPath":"tests/__data__/input/sites/example.com.config.js","site":"example.com","date":"2022-01-30T00:00:00.000Z","groups":["ca-nl/example.com"],"error":null,"cluster_id":1,"_id":"TYDwYLsrkmPtTLT2"} +{"channel":{"lang":"ru","xmltv_id":"CNNInternationalEurope.us","site_id":"140"},"configPath":"tests/__data__/input/sites/example.com.config.js","site":"example.com","date":"2022-01-31T00:00:00.000Z","groups":["ca-nl/example.com"],"error":null,"cluster_id":1,"_id":"98cKRthEhMmKEnwx"}