mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-16 03:50:03 -04:00
Update format.js
This commit is contained in:
parent
8127e77b07
commit
9c2285ba48
1 changed files with 4 additions and 7 deletions
|
@ -38,7 +38,7 @@ async function main() {
|
||||||
.then(removeDuplicates)
|
.then(removeDuplicates)
|
||||||
.then(detectResolution)
|
.then(detectResolution)
|
||||||
.then(updateFromEPG)
|
.then(updateFromEPG)
|
||||||
.then(updatePlaylist)
|
.then(savePlaylist)
|
||||||
.then(done)
|
.then(done)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ async function main() {
|
||||||
await loadPlaylist('channels/unsorted.m3u')
|
await loadPlaylist('channels/unsorted.m3u')
|
||||||
.then(removeUnsortedDuplicates)
|
.then(removeUnsortedDuplicates)
|
||||||
.then(sortChannels)
|
.then(sortChannels)
|
||||||
.then(updatePlaylist)
|
.then(savePlaylist)
|
||||||
.then(done)
|
.then(done)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,12 +191,9 @@ async function removeUnsortedDuplicates(playlist) {
|
||||||
return playlist
|
return playlist
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updatePlaylist(playlist) {
|
async function savePlaylist(playlist) {
|
||||||
const original = utils.readFile(playlist.url)
|
const original = utils.readFile(playlist.url)
|
||||||
let output = playlist.getHeader()
|
const output = playlist.toString(true)
|
||||||
for (let channel of playlist.channels) {
|
|
||||||
output += channel.toString(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (original === output) {
|
if (original === output) {
|
||||||
console.info(`No changes have been made.`)
|
console.info(`No changes have been made.`)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue