mirror of
https://github.com/iptv-org/epg
synced 2026-05-06 09:27:03 -04:00
Fix linter issues in sites/
This commit is contained in:
@@ -13,11 +13,11 @@ module.exports = {
|
||||
site: 'visionplus.id',
|
||||
days: 2,
|
||||
url({ date, channel }) {
|
||||
return `https://www.visionplus.id/managetv/tvinfo/events/schedule?language=${languages[channel.lang]}&serviceId=${channel.site_id}&start=${date.format(
|
||||
'YYYY-MM-DD'
|
||||
)}T00%3A00%3A00Z&end=${date.add(1, 'd').format(
|
||||
'YYYY-MM-DD'
|
||||
)}T00%3A00%3A00Z&view=cd-events-grid-view`
|
||||
return `https://www.visionplus.id/managetv/tvinfo/events/schedule?language=${
|
||||
languages[channel.lang]
|
||||
}&serviceId=${channel.site_id}&start=${date.format('YYYY-MM-DD')}T00%3A00%3A00Z&end=${date
|
||||
.add(1, 'd')
|
||||
.format('YYYY-MM-DD')}T00%3A00%3A00Z&view=cd-events-grid-view`
|
||||
},
|
||||
parser({ content, channel }) {
|
||||
const programs = []
|
||||
@@ -26,7 +26,13 @@ module.exports = {
|
||||
for (const ev of json.evs) {
|
||||
if (ev.sid === channel.site_id) {
|
||||
const title = ev.con && ev.con.loc ? ev.con.loc[0].tit : ev.con.oti
|
||||
const [, , season, , episode] = title.match(/( S(\d+))?(, Ep (\d+))/) || [null, null, null, null, null]
|
||||
const [, , season, , episode] = title.match(/( S(\d+))?(, Ep (\d+))/) || [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
programs.push({
|
||||
title,
|
||||
description: ev.con && ev.con.loc ? ev.con.loc[0].syn : null,
|
||||
|
||||
@@ -16,7 +16,7 @@ const channel = {
|
||||
xmltv_id: 'AXN.id',
|
||||
lang: 'en'
|
||||
}
|
||||
const channelId = { ...channel, lang: 'id' }
|
||||
const channelId = { ...channel, lang: 'id' }
|
||||
|
||||
it('can generate valid url', () => {
|
||||
expect(url({ channel, date })).toBe(
|
||||
@@ -29,37 +29,37 @@ it('can generate valid url', () => {
|
||||
|
||||
it('can parse response', () => {
|
||||
let content = fs.readFileSync(path.resolve(__dirname, '__data__/content_en.json'))
|
||||
let results = parser({ content, channel, date })
|
||||
.map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
return p
|
||||
})
|
||||
let results = parser({ content, channel, date }).map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
return p
|
||||
})
|
||||
|
||||
expect(results.length).toBe(1)
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2024-11-23T23:30:00.000Z',
|
||||
stop: '2024-11-24T00:15:00.000Z',
|
||||
title: 'FBI: Most Wanted S4, Ep 18',
|
||||
description: 'After two agents from the Bureau of Land Management go missing while executing a land seizure warrant in Wyoming, the Fugitive Task Force heads west to track them down in an unwelcoming county.',
|
||||
description:
|
||||
'After two agents from the Bureau of Land Management go missing while executing a land seizure warrant in Wyoming, the Fugitive Task Force heads west to track them down in an unwelcoming county.',
|
||||
season: 4,
|
||||
episode: 18
|
||||
})
|
||||
|
||||
content = fs.readFileSync(path.resolve(__dirname, '__data__/content_id.json'))
|
||||
results = parser({ content, channel: channelId, date })
|
||||
.map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
return p
|
||||
})
|
||||
results = parser({ content, channel: channelId, date }).map(p => {
|
||||
p.start = p.start.toJSON()
|
||||
p.stop = p.stop.toJSON()
|
||||
return p
|
||||
})
|
||||
|
||||
expect(results.length).toBe(1)
|
||||
expect(results[0]).toMatchObject({
|
||||
start: '2024-11-23T23:30:00.000Z',
|
||||
stop: '2024-11-24T00:15:00.000Z',
|
||||
title: 'FBI: Most Wanted S4, Ep 18',
|
||||
description: 'Satgas Buronan pergi ke wilayah barat untuk melacak keberadaan dua petugas Biro Pengelolaan Lahan yang menghilang saat menjalankan perintah penyitaan lahan di negara bagian yang tak ramah, Wyoming.',
|
||||
description:
|
||||
'Satgas Buronan pergi ke wilayah barat untuk melacak keberadaan dua petugas Biro Pengelolaan Lahan yang menghilang saat menjalankan perintah penyitaan lahan di negara bagian yang tak ramah, Wyoming.',
|
||||
season: 4,
|
||||
episode: 18
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user