Update create-queue.js

This commit is contained in:
Aleksandr Statciuk 2022-01-31 00:55:59 +03:00
parent b493c5ec1e
commit fa34132d15
2 changed files with 10 additions and 9 deletions

View file

@ -48,15 +48,16 @@ async function createQueue() {
for (const d of dates) { for (const d of dates) {
const dString = d.toJSON() const dString = d.toJSON()
const key = `${item.site}:${item.site_id}:${dString}` const key = `${item.site}:${item.site_id}:${dString}`
console.log(key)
if (!queue[key]) { if (!queue[key]) {
queue[key] = { queue[key] = {
lang: item.lang, channel: {
xmltv_id: item.xmltv_id, lang: item.lang,
site_id: item.site_id, xmltv_id: item.xmltv_id,
site_id: item.site_id
},
site: item.site, site: item.site,
date: dString, date: dString,
configPath: item.configPath, configPath,
groups: [], groups: [],
error: null error: null
} }

View file

@ -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"} {"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"}
{"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"} {"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"}
{"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"} {"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"}
{"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":"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"}