mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Filter out repeated schedule events from sky.com.
Signed-off-by: Toha <tohenk@yahoo.com>
This commit is contained in:
parent
1b62393008
commit
67509d97b1
1 changed files with 11 additions and 10 deletions
|
@ -18,7 +18,7 @@ module.exports = {
|
|||
channel.site_id
|
||||
}`
|
||||
},
|
||||
parser({ content, channel }) {
|
||||
parser({ content, channel, date }) {
|
||||
const programs = []
|
||||
if (content) {
|
||||
const items = JSON.parse(content) || null
|
||||
|
@ -30,15 +30,16 @@ module.exports = {
|
|||
schedule.events
|
||||
.forEach(event => {
|
||||
const start = dayjs.utc(event.st * 1000)
|
||||
const stop = start.add(event.d, 's')
|
||||
programs.push({
|
||||
title: event.t,
|
||||
description: event.sy,
|
||||
season: event.seasonnumber,
|
||||
episode: event.episodenumber,
|
||||
start,
|
||||
stop
|
||||
})
|
||||
if (start.isSame(date, 'd')) {
|
||||
programs.push({
|
||||
title: event.t,
|
||||
description: event.sy,
|
||||
season: event.seasonnumber,
|
||||
episode: event.episodenumber,
|
||||
start,
|
||||
stop: start.add(event.d, 's')
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue