Update generate-playlist.js

This commit is contained in:
Aleksandr Statciuk
2022-02-11 19:56:11 +03:00
parent d3774679bd
commit e3e4441909
65 changed files with 246 additions and 156 deletions

View File

@@ -1,3 +1,12 @@
module.exports = function () {
return this.group_title || 'Undefined'
if (this.group_title) return this.group_title
if (this.categories.length) {
return this.categories
.map(category => category.name)
.sort()
.join(';')
}
return 'Undefined'
}

View File

@@ -2,6 +2,5 @@ exports.group_title = require('./group_title')
exports.title = require('./title')
exports.tvg_id = require('./tvg_id')
exports.tvg_logo = require('./tvg_logo')
exports.tvg_url = require('./tvg_url')
exports.tvg_country = require('./tvg_country')
exports.tvg_language = require('./tvg_language')

View File

@@ -1,3 +1,16 @@
module.exports = function () {
return this.tvg_country || ''
if (this.tvg_country) return this.tvg_country
if (this.broadcast_area.length) {
return this.broadcast_area
.map(item => {
const [_, code] = item.split('/')
return code
})
.filter(i => i)
.sort()
.join(';')
}
return ''
}

View File

@@ -1,3 +1,13 @@
module.exports = function () {
return this.tvg_language || ''
if (this.tvg_language) return this.tvg_language
if (this.languages.length) {
return this.languages
.map(language => (language ? language.name : null))
.filter(l => l)
.sort()
.join(';')
}
return ''
}

View File

@@ -1,3 +1,5 @@
module.exports = function () {
return this.tvg_logo || ''
if (this.tvg_logo) return this.tvg_logo
return this.logo || ''
}

View File

@@ -1,3 +0,0 @@
module.exports = function () {
return this.tvg_url || ''
}