mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Update dstv.com.config.js
This commit is contained in:
parent
11b7d16453
commit
9f79043e18
1 changed files with 14 additions and 12 deletions
|
@ -19,24 +19,26 @@ module.exports = {
|
||||||
return channel.logo
|
return channel.logo
|
||||||
},
|
},
|
||||||
parser({ content, date, channel }) {
|
parser({ content, date, channel }) {
|
||||||
let PM = false
|
|
||||||
const programs = []
|
const programs = []
|
||||||
const items = parseItems(content, date, channel)
|
const items = parseItems(content, date, channel)
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
const title = item.title
|
const prev = programs[programs.length - 1]
|
||||||
let start = parseStart(item, date)
|
let start = parseStart(item, date)
|
||||||
if (start.hour() > 18 && !PM) start = start.subtract(1, 'd')
|
if (prev) {
|
||||||
else if (start.hour() > 11 && start.hour() < 18) PM = true
|
if (start.isBefore(prev.start)) {
|
||||||
else if (start.hour() < 12 && PM) start = start.add(1, 'd')
|
start = start.add(1, 'd')
|
||||||
const stop = start.add(1, 'h')
|
date = date.add(1, 'd')
|
||||||
if (programs.length) {
|
}
|
||||||
programs[programs.length - 1].stop = start.toString()
|
prev.stop = start
|
||||||
|
} else if (start.hour() > 12) {
|
||||||
|
start = start.subtract(1, 'd')
|
||||||
|
date = date.subtract(1, 'd')
|
||||||
}
|
}
|
||||||
|
const stop = start.add(1, 'h')
|
||||||
programs.push({
|
programs.push({
|
||||||
title,
|
title: item.title,
|
||||||
start: start.toString(),
|
start,
|
||||||
stop: stop.toString()
|
stop
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue