mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 08:30:06 -04:00
sync with master
This commit is contained in:
commit
4c44d449db
2 changed files with 15 additions and 1 deletions
|
@ -16,9 +16,12 @@ module.exports = {
|
|||
const start = parseStart(item)
|
||||
const stop = parseStop(item, start)
|
||||
programs.push({
|
||||
title: item.season?.serie?.title ? item.season.serie.title : item.title,
|
||||
title: item.title,
|
||||
subTitle: item.season?.serie?.title,
|
||||
category: item.genreDetailed,
|
||||
description: item.synopsis,
|
||||
season: parseSeason(item),
|
||||
episode: parseEpisode(item),
|
||||
image: parseImage(item),
|
||||
start: start.toJSON(),
|
||||
stop: stop.toJSON()
|
||||
|
@ -61,6 +64,14 @@ function parseStop(item, start) {
|
|||
return start.add(item.duration, 's')
|
||||
}
|
||||
|
||||
function parseSeason(item) {
|
||||
return item.season?.number
|
||||
}
|
||||
|
||||
function parseEpisode(item) {
|
||||
return item.episodeNumber
|
||||
}
|
||||
|
||||
function parseItems(content, channel) {
|
||||
const data = JSON.parse(content)
|
||||
|
||||
|
|
|
@ -27,6 +27,9 @@ it('can parse response', () => {
|
|||
start: '2021-11-07T23:35:00.000Z',
|
||||
stop: '2021-11-08T00:20:00.000Z',
|
||||
title: 'Tête de liste',
|
||||
subTitle: 'Esprits criminels',
|
||||
season: 10,
|
||||
episode: 12,
|
||||
description:
|
||||
"Un tueur en série prend un plaisir pervers à prévenir les autorités de Tallahassee avant chaque nouveau meurtre. Rossi apprend le décès d'un de ses vieux amis.",
|
||||
category: 'Série Suspense',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue