Fix linter issues in sites/

This commit is contained in:
freearhey 2025-01-01 12:27:22 +03:00
parent d6d20b6413
commit 5df982bb7c
129 changed files with 3316 additions and 3226 deletions

View file

@ -12,9 +12,7 @@ module.exports = {
site: 'sky.com',
days: 2,
url({ date, channel }) {
return `https://awk.epgsky.com/hawk/linear/schedule/${
date.format('YYYYMMDD')
}/${
return `https://awk.epgsky.com/hawk/linear/schedule/${date.format('YYYYMMDD')}/${
channel.site_id
}`
},
@ -27,19 +25,18 @@ module.exports = {
.filter(schedule => schedule.sid === channel.site_id)
.forEach(schedule => {
if (Array.isArray(schedule.events)) {
schedule.events
.forEach(event => {
const start = dayjs.utc(event.st * 1000)
const stop = start.add(event.d, 's')
programs.push({
title: event.t,
description: event.sy,
season: event.seasonnumber,
episode: event.episodenumber,
start,
stop
})
schedule.events.forEach(event => {
const start = dayjs.utc(event.st * 1000)
const stop = start.add(event.d, 's')
programs.push({
title: event.t,
description: event.sy,
season: event.seasonnumber,
episode: event.episodenumber,
start,
stop
})
})
}
})
}
@ -55,10 +52,12 @@ module.exports = {
if (queue.t === 'r') {
const $ = cheerio.load(res)
const initialData = JSON.parse(decodeURIComponent($('#initialData').text()))
initialData.state.epgData.regions
.forEach(region => {
queues.push({ t: 'c', url: `https://awk.epgsky.com/hawk/linear/services/${region.bouquet}/${region.subBouquet}` })
initialData.state.epgData.regions.forEach(region => {
queues.push({
t: 'c',
url: `https://awk.epgsky.com/hawk/linear/services/${region.bouquet}/${region.subBouquet}`
})
})
}
// process channels
if (queue.t === 'c') {

View file

@ -15,9 +15,7 @@ const channel = {
}
it('can generate valid url', () => {
expect(url({ channel, date })).toBe(
'https://awk.epgsky.com/hawk/linear/schedule/20241214/4086'
)
expect(url({ channel, date })).toBe('https://awk.epgsky.com/hawk/linear/schedule/20241214/4086')
})
it('can parse response', () => {
@ -34,7 +32,7 @@ it('can parse response', () => {
stop: '2024-12-13T23:00:00.000Z',
title: 'The UnXplained With...',
description:
'The Hunt for Jack the Ripper: Jack the Ripper\'s identity has eluded police, historians and armchair detectives for over a century. What do we know about the notorious killer? (S3, ep 21)',
"The Hunt for Jack the Ripper: Jack the Ripper's identity has eluded police, historians and armchair detectives for over a century. What do we know about the notorious killer? (S3, ep 21)",
season: 4,
episode: 14
})