mirror of
https://github.com/iptv-org/iptv.git
synced 2025-05-13 10:30:03 -04:00
Updated Playlist.save() method
This commit is contained in:
parent
27136370aa
commit
1c05547389
5 changed files with 8 additions and 4 deletions
|
@ -10,6 +10,7 @@ module.exports = class Playlist {
|
|||
this.channels = items
|
||||
.map(item => new Channel({ data: item, header, sourceUrl: url }))
|
||||
.filter(channel => channel.url)
|
||||
this.updated = false
|
||||
}
|
||||
|
||||
toString(options = {}) {
|
||||
|
@ -31,10 +32,8 @@ module.exports = class Playlist {
|
|||
}
|
||||
|
||||
save() {
|
||||
const original = file.read(this.url)
|
||||
const output = this.toString()
|
||||
if (original !== output) {
|
||||
file.create(this.url, output)
|
||||
if (this.updated) {
|
||||
file.create(this.url, this.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue