From ec9489660861d34b4fff06d5bf49813db4dd2bde Mon Sep 17 00:00:00 2001 From: freearhey Date: Wed, 27 Jan 2021 18:33:14 +0300 Subject: [PATCH] Update update-readme.js --- scripts/update-readme.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/update-readme.js b/scripts/update-readme.js index b6f22ef91..fdea7885d 100644 --- a/scripts/update-readme.js +++ b/scripts/update-readme.js @@ -26,6 +26,15 @@ function parseIndex() { let countries = {} let languages = {} let categories = {} + + for (let categoryCode in helper.supportedCategories) { + categories[categoryCode] = { + category: helper.supportedCategories[categoryCode], + channels: 0, + playlist: `https://iptv-org.github.io/iptv/categories/${categoryCode}.m3u` + } + } + for (let rootItem of root.items) { const playlist = helper.parsePlaylist(rootItem.url) const countryName = rootItem.name @@ -74,12 +83,6 @@ function parseIndex() { const categoryCode = categoryName.toLowerCase() if (categories[categoryCode]) { categories[categoryCode].channels++ - } else { - categories[categoryCode] = { - category: categoryName, - channels: 1, - playlist: `https://iptv-org.github.io/iptv/categories/${categoryCode}.m3u` - } } } }