mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 10:26:41 -05:00
Season / Episode
Validation of season / episode part 2
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user