mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 02:16:40 -05:00
Update update-codes.js
This commit is contained in:
@@ -35,7 +35,8 @@ async function main() {
|
||||
if (a.display_name.toLowerCase() > b.display_name.toLowerCase()) return 1
|
||||
return 0
|
||||
})
|
||||
writeToFile('codes.csv', convertToCSV(sorted))
|
||||
writeToFile('codes.json', convertToJSON(sorted))
|
||||
// writeToFile('codes.csv', convertToCSV(sorted))
|
||||
console.log('Done')
|
||||
})
|
||||
}
|
||||
@@ -50,6 +51,10 @@ function writeToFile(filename, data) {
|
||||
fs.writeFileSync(path.resolve(filename), data)
|
||||
}
|
||||
|
||||
function convertToJSON(arr) {
|
||||
return JSON.stringify(arr, null, 2)
|
||||
}
|
||||
|
||||
function convertToCSV(arr) {
|
||||
let string = 'display_name,tvg_id,country,logo\n'
|
||||
for (const item of arr) {
|
||||
|
||||
Reference in New Issue
Block a user