mirror of
https://github.com/iptv-org/epg
synced 2025-12-18 11:27:06 -05:00
Merge branch 'master' of github.com:iptv-org/epg
This commit is contained in:
@@ -18,8 +18,8 @@ module.exports = {
|
|||||||
title: item.eventTitle,
|
title: item.eventTitle,
|
||||||
description: item.eventSynopsis,
|
description: item.eventSynopsis,
|
||||||
category: parseCategory(item),
|
category: parseCategory(item),
|
||||||
season: item.content.seasonNumber || null,
|
season: parseSeason(item),
|
||||||
episode: item.content.episodeNumber || null,
|
episode: parseEpisode(item),
|
||||||
start: parseStart(item),
|
start: parseStart(item),
|
||||||
stop: parseStop(item),
|
stop: parseStop(item),
|
||||||
url: parseURL(item),
|
url: parseURL(item),
|
||||||
@@ -57,3 +57,15 @@ function parseIcon(item) {
|
|||||||
|
|
||||||
return cover && cover.img && cover.img.url ? `https://guidatv.sky.it${cover.img.url}` : null
|
return cover && cover.img && cover.img.url ? `https://guidatv.sky.it${cover.img.url}` : null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseSeason(item) {
|
||||||
|
if (!item.content.seasonNumber) return null
|
||||||
|
if (String(item.content.seasonNumber)).length > 2) return null
|
||||||
|
return item.content.seasonNumber
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseEpisode(item) {
|
||||||
|
if (!item.content.episodeNumber) return null
|
||||||
|
if (String(item.content.episodeNumber).length > 3) return null
|
||||||
|
return item.content.episodeNumber
|
||||||
|
}
|
||||||
@@ -67,8 +67,8 @@ module.exports = {
|
|||||||
actors: detail.actors,
|
actors: detail.actors,
|
||||||
directors: detail.directors,
|
directors: detail.directors,
|
||||||
producers: detail.producers,
|
producers: detail.producers,
|
||||||
season: detail.seasonNumber,
|
season: parseSeason(detail),
|
||||||
episode: detail.episodeNumber,
|
episode: parseEpisode(detail),
|
||||||
start: parseStart(item),
|
start: parseStart(item),
|
||||||
stop: parseStop(item)
|
stop: parseStop(item)
|
||||||
})
|
})
|
||||||
@@ -120,3 +120,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
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ module.exports = {
|
|||||||
programs.push({
|
programs.push({
|
||||||
title: item.name || item.program.name,
|
title: item.name || item.program.name,
|
||||||
description: item.description,
|
description: item.description,
|
||||||
season: item.season || null,
|
season: parseSeason(item) ,
|
||||||
episode: item.episode || null,
|
episode: parseEpisode(item),
|
||||||
sub_title : item['episode_title'] || null,
|
sub_title : item['episode_title'] || null,
|
||||||
url : parseURL(item),
|
url : parseURL(item),
|
||||||
start,
|
start,
|
||||||
@@ -64,3 +64,15 @@ function parseURL(item) {
|
|||||||
}
|
}
|
||||||
return url
|
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