mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update update-codes.js
This commit is contained in:
parent
417c4d6dad
commit
612001a43c
1 changed files with 6 additions and 1 deletions
|
@ -35,7 +35,8 @@ async function main() {
|
||||||
if (a.display_name.toLowerCase() > b.display_name.toLowerCase()) return 1
|
if (a.display_name.toLowerCase() > b.display_name.toLowerCase()) return 1
|
||||||
return 0
|
return 0
|
||||||
})
|
})
|
||||||
writeToFile('codes.csv', convertToCSV(sorted))
|
writeToFile('codes.json', convertToJSON(sorted))
|
||||||
|
// writeToFile('codes.csv', convertToCSV(sorted))
|
||||||
console.log('Done')
|
console.log('Done')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -50,6 +51,10 @@ function writeToFile(filename, data) {
|
||||||
fs.writeFileSync(path.resolve(filename), data)
|
fs.writeFileSync(path.resolve(filename), data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function convertToJSON(arr) {
|
||||||
|
return JSON.stringify(arr, null, 2)
|
||||||
|
}
|
||||||
|
|
||||||
function convertToCSV(arr) {
|
function convertToCSV(arr) {
|
||||||
let string = 'display_name,tvg_id,country,logo\n'
|
let string = 'display_name,tvg_id,country,logo\n'
|
||||||
for (const item of arr) {
|
for (const item of arr) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue