mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Update telenet.tv.config.js
Added length check to season / episode
This commit is contained in:
parent
942b78078e
commit
5f7919e3d1
1 changed files with 14 additions and 2 deletions
|
@ -64,8 +64,8 @@ module.exports = {
|
||||||
description: detail.longDescription,
|
description: detail.longDescription,
|
||||||
category: detail.genres,
|
category: detail.genres,
|
||||||
actors: detail.actors,
|
actors: detail.actors,
|
||||||
season: detail.seasonNumber,
|
season: parseSeason(detail),
|
||||||
episode: detail.episodeNumber,
|
episode: parseEpisode(detail),
|
||||||
start: parseStart(item),
|
start: parseStart(item),
|
||||||
stop: parseStop(item)
|
stop: parseStop(item)
|
||||||
})
|
})
|
||||||
|
@ -117,3 +117,15 @@ function parseItems(content, channel) {
|
||||||
|
|
||||||
return Array.isArray(channelData.events) ? channelData.events : []
|
return Array.isArray(channelData.events) ? channelData.events : []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseSeason(detail) {
|
||||||
|
if (!detail.seasonNumber) return null
|
||||||
|
if (String(detail.seasonNumber).length > 2) return null
|
||||||
|
return detail.seasonNumber
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseEpisode(detail) {
|
||||||
|
if (!detail.episodeNumber) return null
|
||||||
|
if (String(detail.episodeNumber).length > 3) return null
|
||||||
|
return detail.episodeNumber
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue