This commit is contained in:
Aleksandr Statciuk
2022-02-07 00:04:56 +03:00
parent d604f35ba1
commit 9a4a62fd10
45 changed files with 733 additions and 35060 deletions

View File

@@ -1,5 +1,5 @@
module.exports = function () {
if (this.group_title) return this.group_title
if (this.group_title !== undefined) return this.group_title
if (Array.isArray(this.categories)) {
return this.categories

View File

@@ -1,5 +1,5 @@
exports.group_title = require('./group_title')
exports.display_name = require('./display_name')
exports.title = require('./title')
exports.tvg_country = require('./tvg_country')
exports.tvg_id = require('./tvg_id')
exports.tvg_language = require('./tvg_language')

View File

@@ -1,5 +1,5 @@
module.exports = function () {
let title = this.title
let title = this.channel_name
if (this.resolution.height) {
title += ` (${this.resolution.height}p)`

View File

@@ -1,5 +1,3 @@
module.exports = function () {
if (this.tvg_country) return this.tvg_country
return Array.isArray(this.countries) ? this.countries.map(i => i.code).join(';') : ''
return Array.isArray(this.broadcast_area) ? this.broadcast_area.join(';') : ''
}

View File

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

View File

@@ -1,3 +1,3 @@
module.exports = function () {
return this.logo || ''
return this.channel && this.channel.logo ? this.channel.logo : ''
}

View File

@@ -1,5 +1,10 @@
const { parser } = require('../../core')
module.exports = function ({ title }) {
return parser.parseChannelName(title)
return title
.trim()
.split(' ')
.map(s => s.trim())
.filter(s => {
return !/\[|\]/i.test(s) && !/\((\d+)P\)/i.test(s)
})
.join(' ')
}