Update update-readme.js

This commit is contained in:
Aleksandr Statciuk 2022-01-15 00:07:11 +03:00
parent 23d9089628
commit 5db31acc83
3 changed files with 16 additions and 25 deletions

View file

@ -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: `<code>https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml</code>`,
status: statuses[item.status]
epg: `<code>https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml</code>`
})
}
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: `<code>https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml</code>`,
status: statuses[item.status]
epg: `<code>https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml</code>`
})
}
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: `<code>https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml</code>`,
status: statuses[item.status]
epg: `<code>https://iptv-org.github.io/epg/guides/${item.gid}/${item.site}.epg.xml</code>`
})
}
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)
}

View file

@ -21,7 +21,6 @@ markdown.createTable = function (data, cols) {
if (i === 0) output += `<td align="left" valign="top" nowrap${rowspan}>${item.name}</td>`
output += `<td align="right">${item.channels}</td>`
output += `<td align="left" nowrap>${item.epg}</td>`
output += `<td align="center">${item.status}</td>`
output += '</tr>\n'
}
}