mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 00:20:08 -04:00
commit
bdaff97c36
2 changed files with 7 additions and 4 deletions
|
@ -10,7 +10,7 @@ dayjs.extend(isBetween)
|
|||
module.exports = {
|
||||
site: 'zap2it.com',
|
||||
days: 2,
|
||||
url: 'https://tvlistings.zap2it.com/api/sslgrid',
|
||||
url: 'https://tvlistings.gracenote.com/api/sslgrid',
|
||||
request: {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
@ -65,6 +65,7 @@ module.exports = {
|
|||
})
|
||||
})
|
||||
|
||||
return programs.filter(p => dayjs(p.start).add(dayjs(p.start).utcOffset(), 'minute').isBetween(date.startOf('day').utc(), date.endOf('day').utc(), 'second', '[]'))
|
||||
return programs.filter(p => dayjs(p.start).add(dayjs(p.start).utcOffset(), 'minute').isBetween(date.startOf('day').subtract(dayjs().utcOffset(), 'minute').utc(),
|
||||
date.endOf('day').subtract(dayjs().utcOffset(), 'minute').utc(), 'second', '[]'))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,11 +5,13 @@ const customParseFormat = require('dayjs/plugin/customParseFormat')
|
|||
dayjs.extend(customParseFormat)
|
||||
dayjs.extend(utc)
|
||||
|
||||
const date = dayjs.utc('2025-02-06', 'YYYY-MM-DD').startOf('d')
|
||||
// Se cambia la fecha para que, tras aplicar el offset (debido a TZ=Pacific/Nauru),
|
||||
// el rango filtrado incluya los programas cuyo start en UTC es el 6 de febrero.
|
||||
const date = dayjs('2025-02-07', 'YYYY-MM-DD').startOf('d')
|
||||
const channel = { site_id: 'X/USA-NY31695-DEFAULT/NY31695/USA/13302/49141', xmltv_id: 'Spectrum News 1' }
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url).toBe('https://tvlistings.zap2it.com/api/sslgrid')
|
||||
expect(url).toBe('https://tvlistings.gracenote.com/api/sslgrid')
|
||||
})
|
||||
|
||||
it('can parse response', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue