mirror of
https://github.com/iptv-org/epg
synced 2025-12-18 03:16:53 -05:00
simplify
This commit is contained in:
@@ -15,8 +15,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
url: function ({ channel, date }) {
|
url: function ({ channel, date }) {
|
||||||
const datetime = DateTime.fromJSDate(date.toDate()).setZone('Europe/Lisbon')
|
const datetime = DateTime.fromJSDate(date.toDate()).setZone('Europe/Lisbon')
|
||||||
const month = datetime.month
|
const formattedMonth = datetime.month < 10 ? `0${datetime.month}` : datetime.month
|
||||||
const formattedMonth = month < 10 ? `0${month}` : month
|
|
||||||
const formattedDay = datetime.day < 10 ? `0${datetime.day}` : datetime.day
|
const formattedDay = datetime.day < 10 ? `0${datetime.day}` : datetime.day
|
||||||
return `${API_ENDPOINT}/${channel.site_id}/${date.year()}/${formattedMonth}/${formattedDay}/00-06`
|
return `${API_ENDPOINT}/${channel.site_id}/${date.year()}/${formattedMonth}/${formattedDay}/00-06`
|
||||||
},
|
},
|
||||||
@@ -25,8 +24,7 @@ module.exports = {
|
|||||||
let items = parseItems(content)
|
let items = parseItems(content)
|
||||||
if (!items.length) return programs
|
if (!items.length) return programs
|
||||||
const datetime = DateTime.fromJSDate(date.toDate()).setZone('Europe/Lisbon')
|
const datetime = DateTime.fromJSDate(date.toDate()).setZone('Europe/Lisbon')
|
||||||
const month = datetime.month
|
const formattedMonth = datetime.month < 10 ? `0${datetime.month}` : datetime.month
|
||||||
const formattedMonth = month < 10 ? `0${month}` : month
|
|
||||||
const formattedDay = datetime.day < 10 ? `0${datetime.day}` : datetime.day
|
const formattedDay = datetime.day < 10 ? `0${datetime.day}` : datetime.day
|
||||||
// map all periods of time to promises in order to get a full schedule in one row
|
// map all periods of time to promises in order to get a full schedule in one row
|
||||||
const promises = [
|
const promises = [
|
||||||
|
|||||||
Reference in New Issue
Block a user