Update tvtv.us.config.js

This commit is contained in:
Aleksandr Statciuk 2022-02-01 02:25:29 +03:00
parent f6f20c28e4
commit 9c95901acf

View file

@ -11,9 +11,6 @@ module.exports = {
channel.site_id
}/airings?startDateTime=${date.format()}&endDateTime=${date.add(1, 'd').format()}`
},
logo({ channel }) {
return channel.logo
},
parser: function ({ content }) {
let programs = []
@ -50,22 +47,19 @@ module.exports = {
if (!stationData) continue
let channel
const logo = parseChannelLogo(stationData.preferredImage)
switch (stationData.type) {
case 'Low Power Broadcast':
case 'Full Power Broadcast':
channel = {
site_id: station.id,
name: stationData.name,
xmltv_id: parseChannelId(stationData),
logo
xmltv_id: parseChannelId(stationData)
}
break
default:
channel = {
site_id: station.id,
name: stationData.name,
logo
name: stationData.name
}
break
}
@ -79,10 +73,6 @@ module.exports = {
}
}
function parseChannelLogo(image) {
return image && image.uri ? `http://tvtv.tmsimg.com/${image.uri}` : null
}
function parseChannelId(data) {
if (!data.callSign) return null
if (/^((CB|C[F-K]|V[A-G]|VO|VX|VY|X[J-O])[0-9A-Z-]+)/.test(data.callSign))