Update tests/__data__

This commit is contained in:
freearhey
2025-04-19 02:04:20 +03:00
parent 9f93a30988
commit e54dfb4042
10 changed files with 68 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<channels site="example.com">
<channel lang="en" xmltv_id="Channel1.us" site_id="140">Channel 1</channel>
<channel lang="en" xmltv_id="Channel2.us" site_id="142" logo="https://i.imgur.com/qmRnD0M.png">Channel 2</channel>
<channel lang="fr" xmltv_id="Channel1.us" site_id="140">Channel 1</channel>
<channel lang="it" xmltv_id="Channel3.us" site_id="143">Channel 3</channel>
</channels>

View File

@@ -0,0 +1,28 @@
module.exports = {
site: 'example.com',
days: 2,
request: {
timeout: 1000
},
url: 'https://example.com',
parser({ channel, date }) {
if (channel.xmltv_id === 'Channel2.us') return []
else if (channel.xmltv_id === 'Channel1.us' && channel.lang === 'fr') {
return [
{
title: 'Programme1 (example.com)',
start: `${date.format('YYYY-MM-DD')}T04:30:00.000Z`,
stop: `${date.format('YYYY-MM-DD')}T07:10:00.000Z`
}
]
}
return [
{
title: 'Program1 (example.com)',
start: `${date.format('YYYY-MM-DD')}T04:30:00.000Z`,
stop: `${date.format('YYYY-MM-DD')}T07:10:00.000Z`
}
]
}
}