Update telenet.tv.config.js

Added length check to season / episode
This commit is contained in:
RevGear 2022-12-22 17:55:21 +00:00
parent 942b78078e
commit 5f7919e3d1

View file

@ -64,8 +64,8 @@ module.exports = {
description: detail.longDescription,
category: detail.genres,
actors: detail.actors,
season: detail.seasonNumber,
episode: detail.episodeNumber,
season: parseSeason(detail),
episode: parseEpisode(detail),
start: parseStart(item),
stop: parseStop(item)
})
@ -117,3 +117,15 @@ function parseItems(content, channel) {
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
}