mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 08:30:06 -04:00
Fix linter issues
This commit is contained in:
parent
8b0952b915
commit
e8f89b216c
4 changed files with 255 additions and 264 deletions
|
@ -2,7 +2,6 @@ const dayjs = require('dayjs')
|
|||
const utc = require('dayjs/plugin/utc')
|
||||
const timezone = require('dayjs/plugin/timezone')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
const cheerio = require('cheerio')
|
||||
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(timezone)
|
||||
|
@ -29,8 +28,8 @@ module.exports = {
|
|||
|
||||
data.channelEpgs.forEach(channel => {
|
||||
channel.epgPlayables.forEach(epg => {
|
||||
const start = new Date(epg.startTime).toISOString();
|
||||
const stop = new Date(epg.endTime).toISOString();
|
||||
const start = new Date(epg.startTime).toISOString()
|
||||
const stop = new Date(epg.endTime).toISOString()
|
||||
|
||||
programs.push({
|
||||
title: epg.name,
|
||||
|
@ -45,7 +44,7 @@ module.exports = {
|
|||
async channels() {
|
||||
const axios = require('axios')
|
||||
const data = await axios
|
||||
.get(`https://epg.cyta.com.cy/api/mediacatalog/fetchChannels?language=1`)
|
||||
.get('https://epg.cyta.com.cy/api/mediacatalog/fetchChannels?language=1')
|
||||
.then(r => r.data)
|
||||
.catch(console.log)
|
||||
|
||||
|
|
|
@ -30,11 +30,7 @@ it('can parse response', () => {
|
|||
]
|
||||
}`
|
||||
|
||||
const result = parser({ content }).map(p => {
|
||||
p.start = p.start
|
||||
p.stop = p.stop
|
||||
return p
|
||||
})
|
||||
const result = parser({ content })
|
||||
|
||||
expect(result).toMatchObject([
|
||||
{
|
||||
|
|
|
@ -6,7 +6,6 @@ dayjs.extend(utc)
|
|||
|
||||
module.exports = {
|
||||
site: 'stod2.is',
|
||||
channels: 'stod2.is.channels.xml',
|
||||
days: 7,
|
||||
request: {
|
||||
cache: {
|
||||
|
|
|
@ -3,14 +3,11 @@ const dayjs = require('dayjs')
|
|||
const utc = require('dayjs/plugin/utc')
|
||||
const customParseFormat = require('dayjs/plugin/customParseFormat')
|
||||
const timezone = require('dayjs/plugin/timezone')
|
||||
const axios = require('axios')
|
||||
|
||||
dayjs.extend(utc)
|
||||
dayjs.extend(customParseFormat)
|
||||
dayjs.extend(timezone)
|
||||
|
||||
jest.mock('axios')
|
||||
|
||||
const date = dayjs.utc('2025-01-03', 'YYYY-MM-DD').startOf('day')
|
||||
const channel = { site_id: 'stod2', xmltv_id: 'Stod2.is' }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue