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
|
channel.site_id
|
||||||
}`
|
}`
|
||||||
},
|
},
|
||||||
parser({ content, channel }) {
|
parser({ content, channel, date }) {
|
||||||
const programs = []
|
const programs = []
|
||||||
if (content) {
|
if (content) {
|
||||||
const items = JSON.parse(content) || null
|
const items = JSON.parse(content) || null
|
||||||
|
@ -30,15 +30,16 @@ module.exports = {
|
||||||
schedule.events
|
schedule.events
|
||||||
.forEach(event => {
|
.forEach(event => {
|
||||||
const start = dayjs.utc(event.st * 1000)
|
const start = dayjs.utc(event.st * 1000)
|
||||||
const stop = start.add(event.d, 's')
|
if (start.isSame(date, 'd')) {
|
||||||
programs.push({
|
programs.push({
|
||||||
title: event.t,
|
title: event.t,
|
||||||
description: event.sy,
|
description: event.sy,
|
||||||
season: event.seasonnumber,
|
season: event.seasonnumber,
|
||||||
episode: event.episodenumber,
|
episode: event.episodenumber,
|
||||||
start,
|
start,
|
||||||
stop
|
stop: start.add(event.d, 's')
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue