Create scripts/store/getters
This commit is contained in:
parent
0e21288935
commit
21b8ce8731
|
@ -0,0 +1,12 @@
|
|||
module.exports = function () {
|
||||
if (this.group_title) return this.group_title
|
||||
|
||||
if (Array.isArray(this.categories)) {
|
||||
return this.categories
|
||||
.map(i => i.name)
|
||||
.sort()
|
||||
.join(';')
|
||||
}
|
||||
|
||||
return ''
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
exports.group_title = require('./group_title')
|
||||
exports.title = require('./title')
|
||||
exports.tvg_country = require('./tvg_country')
|
||||
exports.tvg_id = require('./tvg_id')
|
||||
exports.tvg_language = require('./tvg_language')
|
||||
exports.tvg_logo = require('./tvg_logo')
|
||||
exports.tvg_url = require('./tvg_url')
|
|
@ -0,0 +1,13 @@
|
|||
module.exports = function () {
|
||||
let title = this.name
|
||||
|
||||
if (this.resolution.height) {
|
||||
title += ` (${this.resolution.height}p)`
|
||||
}
|
||||
|
||||
if (this.status.label) {
|
||||
title += ` [${this.status.label}]`
|
||||
}
|
||||
|
||||
return title
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = function () {
|
||||
if (this.tvg_country) return this.tvg_country
|
||||
|
||||
return Array.isArray(this.countries) ? this.countries.map(i => i.code).join(';') : ''
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function () {
|
||||
return this.id || ''
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function () {
|
||||
return Array.isArray(this.languages) ? this.languages.map(i => i.name).join(';') : ''
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function () {
|
||||
return this.logo || ''
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
module.exports = function () {
|
||||
return this.guides.length ? this.guides[0] : ''
|
||||
}
|
Loading…
Reference in New Issue