mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update update-api.js
This commit is contained in:
parent
b64b9878a4
commit
d2946dfa7a
2 changed files with 4 additions and 2 deletions
|
@ -40,13 +40,15 @@ async function loadPrograms() {
|
||||||
let items = await db.programs.find({})
|
let items = await db.programs.find({})
|
||||||
|
|
||||||
items = items.map(item => {
|
items = items.map(item => {
|
||||||
|
const categories = Array.isArray(item.category) ? item.category : [item.category]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
channel: item.channel,
|
channel: item.channel,
|
||||||
site: item.site,
|
site: item.site,
|
||||||
lang: item.lang,
|
lang: item.lang,
|
||||||
title: item.title,
|
title: item.title,
|
||||||
desc: item.description || null,
|
desc: item.description || null,
|
||||||
categories: item.category || [],
|
categories: categories.filter(i => i),
|
||||||
season: item.season || null,
|
season: item.season || null,
|
||||||
episode: item.episode || null,
|
episode: item.episode || null,
|
||||||
image: item.icon || null,
|
image: item.icon || null,
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue