Fix linter issues

This commit is contained in:
freearhey 2025-01-04 20:48:37 +03:00
parent 8b0952b915
commit e8f89b216c
4 changed files with 255 additions and 264 deletions

View file

@ -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)

View file

@ -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([
{

View file

@ -6,7 +6,6 @@ dayjs.extend(utc)
module.exports = {
site: 'stod2.is',
channels: 'stod2.is.channels.xml',
days: 7,
request: {
cache: {

View file

@ -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' }