Update parser.js

This commit is contained in:
freearhey 2021-01-30 07:19:17 +03:00
parent 9c2285ba48
commit 42b28c0d3f
1 changed files with 7 additions and 2 deletions

View File

@ -87,7 +87,7 @@ class Playlist {
.filter(channel => channel.url) .filter(channel => channel.url)
} }
getHeader() { toString(short = false) {
let parts = ['#EXTM3U'] let parts = ['#EXTM3U']
for (let key in this.header.attrs) { for (let key in this.header.attrs) {
let value = this.header.attrs[key] let value = this.header.attrs[key]
@ -96,7 +96,12 @@ class Playlist {
} }
} }
return `${parts.join(' ')}\n` let output = `${parts.join(' ')}\n`
for (let channel of this.channels) {
output += channel.toString(short)
}
return output
} }
} }