mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 09:00:07 -04:00
Update digiturk.com.tr.config.js
This commit is contained in:
parent
c9ad6b9b5c
commit
f4d8a1d969
1 changed files with 9 additions and 8 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
const _ = require('lodash')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
const utc = require('dayjs/plugin/utc')
|
const utc = require('dayjs/plugin/utc')
|
||||||
const timezone = require('dayjs/plugin/timezone')
|
const timezone = require('dayjs/plugin/timezone')
|
||||||
|
@ -13,28 +14,28 @@ module.exports = {
|
||||||
}/${date.format('YYYY-MM-DD')}/0`
|
}/${date.format('YYYY-MM-DD')}/0`
|
||||||
},
|
},
|
||||||
parser: function ({ content, channel }) {
|
parser: function ({ content, channel }) {
|
||||||
const programs = []
|
let programs = []
|
||||||
const items = parseItems(content, channel)
|
const items = parseItems(content, channel)
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
|
const start = parseStart(item)
|
||||||
|
const stop = start.add(item.BroadcastDuration, 's')
|
||||||
programs.push({
|
programs.push({
|
||||||
title: item.ProgramName,
|
title: item.ProgramName,
|
||||||
description: item.LongDescription,
|
description: item.LongDescription,
|
||||||
category: parseCategory(item),
|
category: parseCategory(item),
|
||||||
start: parseStart(item).toJSON(),
|
start,
|
||||||
stop: parseStop(item).toJSON()
|
stop
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
programs = _.sortBy(programs, 'start')
|
||||||
|
|
||||||
return programs
|
return programs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseStart(item) {
|
function parseStart(item) {
|
||||||
return dayjs.tz(item.BroadcastStart, 'Europe/Istanbul')
|
return dayjs.unix(item.BroadcastTimeStamp, 'Europe/Istanbul')
|
||||||
}
|
|
||||||
|
|
||||||
function parseStop(item) {
|
|
||||||
return dayjs.tz(item.BroadcastEnd, 'Europe/Istanbul')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseCategory(item) {
|
function parseCategory(item) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue