mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 18:37:01 -05:00
Fix linter issues in sites/
This commit is contained in:
@@ -1,45 +1,46 @@
|
||||
const dayjs = require('dayjs')
|
||||
|
||||
module.exports = {
|
||||
site: 'nhl.com',
|
||||
// I'm not sure what `endDate` represents but they only return 1 day of
|
||||
// results, with `endTime`s ocassionally in the following day.
|
||||
days: 1,
|
||||
url: ({ date }) => `https://api-web.nhle.com/v1/network/tv-schedule/${date.toJSON().split("T")[0]}`,
|
||||
parser({ content }) {
|
||||
const programs = []
|
||||
const items = parseItems(content)
|
||||
for (const item of items) {
|
||||
programs.push({
|
||||
title: item.title,
|
||||
description: item.description === item.title ? undefined : item.description,
|
||||
category: "Sports",
|
||||
// image: parseImage(item),
|
||||
start: parseStart(item),
|
||||
stop: parseStop(item)
|
||||
})
|
||||
}
|
||||
|
||||
return programs
|
||||
}
|
||||
}
|
||||
|
||||
// Unfortunately I couldn't determine how these are
|
||||
// supposed to be formatted. Pointers appreciated!
|
||||
// function parseImage(item) {
|
||||
// const uri = item.broadcastImageUrl
|
||||
|
||||
// return uri ? `https://???/${uri}` : null
|
||||
// }
|
||||
|
||||
function parseStart(item) {
|
||||
return dayjs(item.startTime)
|
||||
}
|
||||
|
||||
function parseStop(item) {
|
||||
return dayjs(item.endTime)
|
||||
}
|
||||
|
||||
function parseItems(content) {
|
||||
return JSON.parse(content).broadcasts
|
||||
}
|
||||
const dayjs = require('dayjs')
|
||||
|
||||
module.exports = {
|
||||
site: 'nhl.com',
|
||||
// I'm not sure what `endDate` represents but they only return 1 day of
|
||||
// results, with `endTime`s ocassionally in the following day.
|
||||
days: 1,
|
||||
url: ({ date }) =>
|
||||
`https://api-web.nhle.com/v1/network/tv-schedule/${date.toJSON().split('T')[0]}`,
|
||||
parser({ content }) {
|
||||
const programs = []
|
||||
const items = parseItems(content)
|
||||
for (const item of items) {
|
||||
programs.push({
|
||||
title: item.title,
|
||||
description: item.description === item.title ? undefined : item.description,
|
||||
category: 'Sports',
|
||||
// image: parseImage(item),
|
||||
start: parseStart(item),
|
||||
stop: parseStop(item)
|
||||
})
|
||||
}
|
||||
|
||||
return programs
|
||||
}
|
||||
}
|
||||
|
||||
// Unfortunately I couldn't determine how these are
|
||||
// supposed to be formatted. Pointers appreciated!
|
||||
// function parseImage(item) {
|
||||
// const uri = item.broadcastImageUrl
|
||||
|
||||
// return uri ? `https://???/${uri}` : null
|
||||
// }
|
||||
|
||||
function parseStart(item) {
|
||||
return dayjs(item.startTime)
|
||||
}
|
||||
|
||||
function parseStop(item) {
|
||||
return dayjs(item.endTime)
|
||||
}
|
||||
|
||||
function parseItems(content) {
|
||||
return JSON.parse(content).broadcasts
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user