mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Season / Episode
Validation of season / episode part 2
This commit is contained in:
parent
36d3f2b76c
commit
a0712fab35
3 changed files with 42 additions and 6 deletions
|
@ -31,8 +31,8 @@ module.exports = {
|
|||
programs.push({
|
||||
title: item.name || item.program.name,
|
||||
description: item.description,
|
||||
season: item.season || null,
|
||||
episode: item.episode || null,
|
||||
season: parseSeason(item) ,
|
||||
episode: parseEpisode(item),
|
||||
sub_title : item['episode_title'] || null,
|
||||
url : parseURL(item),
|
||||
start,
|
||||
|
@ -64,3 +64,15 @@ function parseURL(item) {
|
|||
}
|
||||
return url
|
||||
}
|
||||
|
||||
function parseSeason(item) {
|
||||
if (!item.season) return null
|
||||
if (String(item.season).length > 2) return null
|
||||
return item.season
|
||||
}
|
||||
|
||||
function parseEpisode(item) {
|
||||
if (!item.episode) return null
|
||||
if (String(item.episode).length > 3) return null
|
||||
return item.episode
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue