diff --git a/scripts/commands/update-readme.js b/scripts/commands/update-readme.js
index 641dfc6e..8fca31d1 100644
--- a/scripts/commands/update-readme.js
+++ b/scripts/commands/update-readme.js
@@ -9,6 +9,11 @@ const options = program
.parse(process.argv)
.opts()
+const statuses = {
+ 0: 'π’',
+ 1: 'π΄'
+}
+
async function main() {
await api.countries.load()
await api.subdivisions.load()
@@ -33,14 +38,15 @@ async function generateCountriesTable(items = []) {
flag: country.flag,
name: country.name,
channels: item.count,
- epg: `https://iptv-org.github.io/epg/guides/${item.group}.epg.xml
`
+ epg: `https://iptv-org.github.io/epg/guides/${item.group}.epg.xml
`,
+ status: statuses[item.status]
})
}
rows = _.orderBy(rows, ['name', 'channels'], ['asc', 'desc'])
rows = _.groupBy(rows, 'name')
- const table = markdown.createTable(rows, ['Country', 'Channels', 'EPG'])
+ const table = markdown.createTable(rows, ['Country', 'Channels', 'EPG', 'Status'])
await file.create('./.readme/_countries.md', table)
}
@@ -57,14 +63,15 @@ async function generateUSStatesTable(items = []) {
rows.push({
name: state.name,
channels: item.count,
- epg: `https://iptv-org.github.io/epg/guides/${item.group}.epg.xml
`
+ epg: `https://iptv-org.github.io/epg/guides/${item.group}.epg.xml
`,
+ status: statuses[item.status]
})
}
rows = _.orderBy(rows, ['name', 'channels'], ['asc', 'desc'])
rows = _.groupBy(rows, 'name')
- const table = markdown.createTable(rows, ['State', 'Channels', 'EPG'])
+ const table = markdown.createTable(rows, ['State', 'Channels', 'EPG', 'Status'])
await file.create('./.readme/_us-states.md', table)
}
@@ -81,14 +88,15 @@ async function generateCanadaProvincesTable(items = []) {
rows.push({
name: province.name,
channels: item.count,
- epg: `https://iptv-org.github.io/epg/guides/${item.group}.epg.xml
`
+ epg: `https://iptv-org.github.io/epg/guides/${item.group}.epg.xml
`,
+ status: statuses[item.status]
})
}
rows = _.orderBy(rows, ['name', 'channels'], ['asc', 'desc'])
rows = _.groupBy(rows, 'name')
- const table = markdown.createTable(rows, ['Province', 'Channels', 'EPG'])
+ const table = markdown.createTable(rows, ['Province', 'Channels', 'EPG', 'Status'])
await file.create('./.readme/_ca-provinces.md', table)
}
diff --git a/scripts/core/markdown.js b/scripts/core/markdown.js
index 8d7d8750..3d735b18 100644
--- a/scripts/core/markdown.js
+++ b/scripts/core/markdown.js
@@ -24,6 +24,7 @@ markdown.createTable = function (data, cols) {
}
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 c408129f..66277c4f 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
- Country | Channels | EPG |
+ Country | Channels | EPG | Status |
- πΏπ¦ South Africa | 1 | https://iptv-org.github.io/epg/guides/za/dstv.com.epg.xml |
- πΊπΈ United States | 372 | https://iptv-org.github.io/epg/guides/us/tvtv.us.epg.xml |
- 74 | https://iptv-org.github.io/epg/guides/us/magticom.ge.epg.xml |
+ πΏπ¦ South Africa | 1 | https://iptv-org.github.io/epg/guides/za/dstv.com.epg.xml | π’ |
+ πΊπΈ United States | 372 | https://iptv-org.github.io/epg/guides/us/tvtv.us.epg.xml | π’ |
+ 74 | https://iptv-org.github.io/epg/guides/us/magticom.ge.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
- State | Channels | EPG |
+ State | Channels | EPG | Status |
- Puerto Rico | 14 | https://iptv-org.github.io/epg/guides/us-pr/tvtv.us.epg.xml |
- 7 | https://iptv-org.github.io/epg/guides/us-pr/gatotv.com.epg.xml |
- 1 | https://iptv-org.github.io/epg/guides/us-pr/directv.com.epg.xml |
+ Puerto Rico | 14 | https://iptv-org.github.io/epg/guides/us-pr/tvtv.us.epg.xml | π’ |
+ 7 | https://iptv-org.github.io/epg/guides/us-pr/gatotv.com.epg.xml | π΄ |
+ 0 | https://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
- Province | Channels | EPG |
+ Province | Channels | EPG | Status |
- Newfoundland and Labrador | 1 | https://iptv-org.github.io/epg/guides/ca-nl/tvtv.us.epg.xml |
+ Newfoundland and Labrador | 1 | https://iptv-org.github.io/epg/guides/ca-nl/tvtv.us.epg.xml | π’ |
diff --git a/tests/__data__/input/logs/update-guides.log b/tests/__data__/input/logs/update-guides.log
index 39141054..d71cf47e 100644
--- a/tests/__data__/input/logs/update-guides.log
+++ b/tests/__data__/input/logs/update-guides.log
@@ -1,7 +1,7 @@
-{"group":"us/magticom.ge","count":74}
-{"group":"za/dstv.com","count":1}
-{"group":"us-pr/tvtv.us","count":14}
-{"group":"us-pr/gatotv.com","count":7}
-{"group":"us-pr/directv.com","count":1}
-{"group":"ca-nl/tvtv.us","count":1}
-{"group":"us/tvtv.us","count":372}
+{"group":"us/magticom.ge","count":74,"status":0}
+{"group":"za/dstv.com","count":1,"status":0}
+{"group":"us-pr/tvtv.us","count":14,"status":0}
+{"group":"us-pr/gatotv.com","count":7,"status":1}
+{"group":"us-pr/directv.com","count":0,"status":0}
+{"group":"ca-nl/tvtv.us","count":1,"status":0}
+{"group":"us/tvtv.us","count":372,"status":0}