mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
add season data to astro.com.my
This commit is contained in:
parent
92925ba5dc
commit
20fba59bcd
3 changed files with 11 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
|||
"channelStbNumber": "305",
|
||||
"isHd": true,
|
||||
"imageUrl": "https://s3-ap-southeast-1.amazonaws.com/ams-astro/production/images/1035X328883.jpg",
|
||||
"title": "Triumph in the Skies Ep06",
|
||||
"title": "Triumph in the Skies S1 Ep06",
|
||||
"programmeId": "328827",
|
||||
"episodeId": "328883",
|
||||
"datetime": "2022-10-31 00:10:00.0",
|
||||
|
|
|
@ -21,7 +21,7 @@ module.exports = {
|
|||
const stop = start.add(duration, 's')
|
||||
const details = await loadProgramDetails(item)
|
||||
programs.push({
|
||||
title: item.title,
|
||||
title: details.title,
|
||||
sub_title: item.subtitles,
|
||||
description: details.longSynopsis || details.shortSynopsis,
|
||||
actors: parseList(details.cast),
|
||||
|
@ -30,6 +30,7 @@ module.exports = {
|
|||
rating: parseRating(details),
|
||||
categories: parseCategories(details),
|
||||
episode: parseEpisode(item),
|
||||
season: parseSeason(details),
|
||||
start: start,
|
||||
stop: stop
|
||||
})
|
||||
|
@ -45,6 +46,12 @@ function parseEpisode(item) {
|
|||
return number ? parseInt(number) : null
|
||||
}
|
||||
|
||||
function parseSeason(details) {
|
||||
const [_, season] = details.title ? details.title.match(/ S(\d+)/) || [null, null] : [null, null]
|
||||
|
||||
return season ? parseInt(season) : null
|
||||
}
|
||||
|
||||
function parseList(list) {
|
||||
return typeof list === 'string' ? list.split(',') : []
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ it('can parse response', async () => {
|
|||
expect(results[0]).toMatchObject({
|
||||
start: '2022-10-30T16:10:00.000Z',
|
||||
stop: '2022-10-30T17:02:00.000Z',
|
||||
title: 'Triumph in the Skies Ep06',
|
||||
title: 'Triumph in the Skies S1 Ep06',
|
||||
description:
|
||||
'This classic drama depicts the many aspects of two complicated relationships set against an airline company. Will those involved ever find true love?',
|
||||
actors: ['Francis Ng Chun Yu', 'Joe Ma Tak Chung', 'Flora Chan Wai San'],
|
||||
|
@ -60,6 +60,7 @@ it('can parse response', async () => {
|
|||
value: 'U'
|
||||
},
|
||||
episode: 6,
|
||||
season: 1,
|
||||
categories: ['Drama']
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue