Update utils.js
This commit is contained in:
parent
52462de93c
commit
8b92d95d87
14
src/utils.js
14
src/utils.js
|
@ -127,14 +127,8 @@ utils.convertToXMLTV = function ({ channels, programs }) {
|
||||||
const lang = program.lang || 'en'
|
const lang = program.lang || 'en'
|
||||||
const icon = utils.escapeString(program.icon)
|
const icon = utils.escapeString(program.icon)
|
||||||
|
|
||||||
if (start && title) {
|
if (start && stop && title) {
|
||||||
output += `<programme start="${start}"`
|
output += `<programme start="${start}" stop="${stop}" channel="${channel}"><title lang="${lang}">${title}</title>`
|
||||||
|
|
||||||
if (stop) {
|
|
||||||
output += ` stop="${stop}"`
|
|
||||||
}
|
|
||||||
|
|
||||||
output += ` channel="${channel}"><title lang="${lang}">${title}</title>`
|
|
||||||
|
|
||||||
if (description) {
|
if (description) {
|
||||||
output += `<desc lang="${lang}">${description}</desc>`
|
output += `<desc lang="${lang}">${description}</desc>`
|
||||||
|
@ -142,7 +136,9 @@ utils.convertToXMLTV = function ({ channels, programs }) {
|
||||||
|
|
||||||
if (categories.length) {
|
if (categories.length) {
|
||||||
categories.forEach(category => {
|
categories.forEach(category => {
|
||||||
output += `<category lang="${lang}">${utils.escapeString(category)}</category>`
|
if (category) {
|
||||||
|
output += `<category lang="${lang}">${utils.escapeString(category)}</category>`
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue