mirror of
https://github.com/iptv-org/epg
synced 2025-12-18 11:27:06 -05:00
Update telenet.tv.config.js
Added length check to season / episode
This commit is contained in:
@@ -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
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user