Update parser.js

This commit is contained in:
freearhey 2021-05-07 19:18:31 +03:00
parent 5a2b11104b
commit f53d664680
1 changed files with 5 additions and 5 deletions

View File

@ -183,9 +183,7 @@ class Channel {
return '' return ''
} }
toString(raw = false) { getInfo() {
if (raw) return this.raw + '\n'
this.tvg.country = this.tvg.country.toUpperCase() this.tvg.country = this.tvg.country.toUpperCase()
let info = `-1 tvg-id="${this.tvgId}" tvg-name="${this.tvgName}" tvg-country="${this.tvg.country}" tvg-language="${this.tvg.language}" tvg-logo="${this.logo}"` let info = `-1 tvg-id="${this.tvgId}" tvg-name="${this.tvgName}" tvg-country="${this.tvg.country}" tvg-language="${this.tvg.language}" tvg-logo="${this.logo}"`
@ -211,8 +209,10 @@ class Channel {
return info return info
} }
toString(short = false) { toString(raw = false) {
const info = this.getInfo(short) if (raw) return this.raw + '\n'
const info = this.getInfo()
return '#EXTINF:' + info + '\n' + this.url + '\n' return '#EXTINF:' + info + '\n' + this.url + '\n'
} }