mirror of https://github.com/iptv-org/iptv
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
291 B
JavaScript
12 lines
291 B
JavaScript
3 years ago
|
const statuses = require('../../data/statuses')
|
||
|
|
||
|
module.exports = function ({ title, status = {} }) {
|
||
|
if (title) {
|
||
|
const [_, label] = title.match(/\[(.*)\]/i) || [null, null]
|
||
|
|
||
|
return Object.values(statuses).find(s => s.label === label) || statuses['online']
|
||
|
}
|
||
|
|
||
|
return status
|
||
|
}
|