mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Update i.mjh.nz.config.js
This commit is contained in:
parent
ee8870af2e
commit
73888794bf
1 changed files with 26 additions and 1 deletions
|
@ -27,7 +27,7 @@ module.exports = {
|
||||||
parser: function ({ content, channel, date, cached }) {
|
parser: function ({ content, channel, date, cached }) {
|
||||||
const items = parseItems(content, channel, date)
|
const items = parseItems(content, channel, date)
|
||||||
|
|
||||||
return items.map(item => {
|
let programs = items.map(item => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
title: getTitle(item),
|
title: getTitle(item),
|
||||||
|
@ -35,6 +35,10 @@ module.exports = {
|
||||||
categories: getCategories(item)
|
categories: getCategories(item)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
programs = mergeMovieParts(programs)
|
||||||
|
|
||||||
|
return programs
|
||||||
},
|
},
|
||||||
async channels({ path, lang = 'en' }) {
|
async channels({ path, lang = 'en' }) {
|
||||||
let xml = await axios
|
let xml = await axios
|
||||||
|
@ -53,6 +57,27 @@ module.exports = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function mergeMovieParts(programs) {
|
||||||
|
let output = []
|
||||||
|
|
||||||
|
programs.forEach(prog => {
|
||||||
|
let prev = output[output.length - 1]
|
||||||
|
let found =
|
||||||
|
prev &&
|
||||||
|
prog.categories.includes('Movie') &&
|
||||||
|
prev.title === prog.title &&
|
||||||
|
prev.description === prog.description
|
||||||
|
|
||||||
|
if (found) {
|
||||||
|
prev.stop = prog.stop
|
||||||
|
} else {
|
||||||
|
output.push(prog)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
function getTitle(item) {
|
function getTitle(item) {
|
||||||
return item.title.length ? item.title[0].value : null
|
return item.title.length ? item.title[0].value : null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue