This commit is contained in:
freearhey 2019-10-23 13:15:46 +03:00
parent 5de6ad61db
commit 8b4ae200b0

View File

@ -77,6 +77,23 @@ async function main() {
buffer[epgUrl] = epg
}
if(buffer[epgUrl]) {
console.log('Add missing tvg-id from EPG by channel title...')
for(let channel of channels) {
for(let channelId in buffer[epgUrl].channels) {
let c = buffer[epgUrl].channels[channelId]
for(let epgName of c.names) {
let regexp = new RegExp(`^${epgName}`, 'i')
if(regexp.test(channel.title)) {
if(!channel.id) {
channel.id = c.id
}
}
}
}
}
}
if(buffer[epgUrl]) {
console.log(`Fills in missing channel's data...`)
for(let channel of channels) {