From 5db31acc830af6a82f7da9e4ca0d6e9bcafc3a94 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sat, 15 Jan 2022 00:07:11 +0300 Subject: [PATCH] Update update-readme.js --- scripts/commands/update-readme.js | 20 ++++++-------------- scripts/core/markdown.js | 1 - tests/__data__/expected/readme.md | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/scripts/commands/update-readme.js b/scripts/commands/update-readme.js index 8784facf..3f9c1620 100644 --- a/scripts/commands/update-readme.js +++ b/scripts/commands/update-readme.js @@ -7,11 +7,6 @@ const _ = require('lodash') let log = [] -const statuses = { - 0: 'βœ—', - 1: 'βœ“' -} - const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs' const options = program @@ -43,15 +38,14 @@ async function generateCountriesTable() { rows.push({ name: `${country.flag} ${country.name}`, channels: item.count, - epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml`, - status: statuses[item.status] + epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml` }) } rows = _.orderBy(rows, ['name', 'channels'], ['asc', 'desc']) rows = _.groupBy(rows, 'name') - const table = markdown.createTable(rows, ['Country', 'Channels', 'EPG', 'Status']) + const table = markdown.createTable(rows, ['Country', 'Channels', 'EPG']) await file.create('./.readme/_countries.md', table) } @@ -68,15 +62,14 @@ async function generateUSStatesTable() { rows.push({ name: state.name, channels: item.count, - epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml`, - status: statuses[item.status] + epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml` }) } rows = _.orderBy(rows, ['name', 'channels'], ['asc', 'desc']) rows = _.groupBy(rows, 'name') - const table = markdown.createTable(rows, ['State', 'Channels', 'EPG', 'Status']) + const table = markdown.createTable(rows, ['State', 'Channels', 'EPG']) await file.create('./.readme/_us-states.md', table) } @@ -93,15 +86,14 @@ async function generateCanadaProvincesTable() { rows.push({ name: province.name, channels: item.count, - epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml`, - status: statuses[item.status] + epg: `https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml` }) } rows = _.orderBy(rows, ['name', 'channels'], ['asc', 'desc']) rows = _.groupBy(rows, 'name') - const table = markdown.createTable(rows, ['Province', 'Channels', 'EPG', 'Status']) + const table = markdown.createTable(rows, ['Province', 'Channels', 'EPG']) await file.create('./.readme/_ca-provinces.md', table) } diff --git a/scripts/core/markdown.js b/scripts/core/markdown.js index 04309ef6..6488c3f5 100644 --- a/scripts/core/markdown.js +++ b/scripts/core/markdown.js @@ -21,7 +21,6 @@ markdown.createTable = function (data, cols) { if (i === 0) output += `${item.name}` output += `${item.channels}` output += `${item.epg}` - output += `${item.status}` output += '\n' } } diff --git a/tests/__data__/expected/readme.md b/tests/__data__/expected/readme.md index 68e61230..f48d2936 100644 --- a/tests/__data__/expected/readme.md +++ b/tests/__data__/expected/readme.md @@ -11,12 +11,12 @@ To load a program guide, all you need to do is copy the link to one or more of t - + - - - + + +
CountryChannelsEPGStatus
CountryChannelsEPG
πŸ‡ΊπŸ‡Έ United States372https://iptv-org.github.io/epg/guides/us/tvtv.us.epg.xmlβœ“
74https://iptv-org.github.io/epg/guides/us/magticom.ge.epg.xmlβœ“
πŸ‡ΏπŸ‡¦ South Africa1https://iptv-org.github.io/epg/guides/za/dstv.com.epg.xmlβœ“
πŸ‡ΊπŸ‡Έ United States372https://iptv-org.github.io/epg/guides/us/tvtv.us.epg.xml
74https://iptv-org.github.io/epg/guides/us/magticom.ge.epg.xml
πŸ‡ΏπŸ‡¦ South Africa1https://iptv-org.github.io/epg/guides/za/dstv.com.epg.xml
@@ -25,12 +25,12 @@ To load a program guide, all you need to do is copy the link to one or more of t - + - - - + + +
StateChannelsEPGStatus
StateChannelsEPG
Puerto Rico14https://iptv-org.github.io/epg/guides/us-pr/tvtv.us.epg.xmlβœ“
7https://iptv-org.github.io/epg/guides/us-pr/gatotv.com.epg.xmlβœ“
1https://iptv-org.github.io/epg/guides/us-pr/directv.com.epg.xmlβœ“
Puerto Rico14https://iptv-org.github.io/epg/guides/us-pr/tvtv.us.epg.xml
7https://iptv-org.github.io/epg/guides/us-pr/gatotv.com.epg.xml
1https://iptv-org.github.io/epg/guides/us-pr/directv.com.epg.xml
@@ -39,10 +39,10 @@ To load a program guide, all you need to do is copy the link to one or more of t - + - +
ProvinceChannelsEPGStatus
ProvinceChannelsEPG
Newfoundland and Labrador1https://iptv-org.github.io/epg/guides/ca-nl/tvtv.us.epg.xmlβœ“
Newfoundland and Labrador1https://iptv-org.github.io/epg/guides/ca-nl/tvtv.us.epg.xml