Merge pull request #88 from iptv-org/add-guides-prop

Update update-codes.js
This commit is contained in:
Dum4G 2021-09-17 11:37:13 +03:00 committed by GitHub
commit ebdf328fa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -109,7 +109,11 @@ If successful, you should get the following response:
"tvg_id": "CNNUSA.us", "tvg_id": "CNNUSA.us",
"display_name": "CNN USA", "display_name": "CNN USA",
"logo": "https://cdn.tvpassport.com/image/station/100x100/cnn.png", "logo": "https://cdn.tvpassport.com/image/station/100x100/cnn.png",
"country": "us" "country": "us",
"guides": [
"https://iptv-org.github.io/epg/guides/tvtv.us.guide.xml",
...
]
}, },
... ...
] ]

View file

@ -17,8 +17,11 @@ async function main() {
.catch(console.log) .catch(console.log)
const channels = parseChannels(file) const channels = parseChannels(file)
channels.forEach(channel => { channels.forEach(channel => {
if (!codes[channel.tvg_id + channel.display_name]) { if (!codes[channel.tvg_id]) {
codes[channel.tvg_id + channel.display_name] = channel channel.guides = [url]
codes[channel.tvg_id] = channel
} else {
codes[channel.tvg_id].guides.push(url)
} }
}) })
} }