|
|
@ -10,6 +10,7 @@ module.exports = class Playlist {
|
|
|
|
this.channels = items
|
|
|
|
this.channels = items
|
|
|
|
.map(item => new Channel({ data: item, header, sourceUrl: url }))
|
|
|
|
.map(item => new Channel({ data: item, header, sourceUrl: url }))
|
|
|
|
.filter(channel => channel.url)
|
|
|
|
.filter(channel => channel.url)
|
|
|
|
|
|
|
|
this.updated = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
toString(options = {}) {
|
|
|
|
toString(options = {}) {
|
|
|
@ -31,10 +32,8 @@ module.exports = class Playlist {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
save() {
|
|
|
|
save() {
|
|
|
|
const original = file.read(this.url)
|
|
|
|
if (this.updated) {
|
|
|
|
const output = this.toString()
|
|
|
|
file.create(this.url, this.toString())
|
|
|
|
if (original !== output) {
|
|
|
|
|
|
|
|
file.create(this.url, output)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|