mirror of
https://github.com/iptv-org/epg
synced 2026-05-06 01:17:02 -04:00
plex config update
plex version bump added rating and ?premiere date
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -8,7 +8,8 @@ module.exports = {
|
|||||||
days: 2,
|
days: 2,
|
||||||
request: {
|
request: {
|
||||||
headers: {
|
headers: {
|
||||||
'x-plex-provider-version': '5.1'
|
'x-plex-provider-version': '7.2',
|
||||||
|
'Accept': 'application/json'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
url: function ({ channel, date }) {
|
url: function ({ channel, date }) {
|
||||||
@@ -23,6 +24,8 @@ module.exports = {
|
|||||||
title: item.grandparentTitle || item.title,
|
title: item.grandparentTitle || item.title,
|
||||||
subTitle: (item.grandparentTitle && item.title !== item.grandparentTitle) ? item.title : null,
|
subTitle: (item.grandparentTitle && item.title !== item.grandparentTitle) ? item.title : null,
|
||||||
description: item.summary,
|
description: item.summary,
|
||||||
|
rating: item.contentRating || null,
|
||||||
|
date: item.originallyAvailableAt ? dayjs(item.originallyAvailableAt).format('YYYY-MM-DD') : (item.year || null),
|
||||||
categories: parseCategories(item),
|
categories: parseCategories(item),
|
||||||
season: item.parentIndex || null,
|
season: item.parentIndex || null,
|
||||||
episode: item.index || null,
|
episode: item.index || null,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jest.mock('axios')
|
|||||||
const date = dayjs.utc('2023-02-05', 'YYYY-MM-DD').startOf('d')
|
const date = dayjs.utc('2023-02-05', 'YYYY-MM-DD').startOf('d')
|
||||||
const channel = {
|
const channel = {
|
||||||
site_id: '5eea605674085f0040ddc7a6',
|
site_id: '5eea605674085f0040ddc7a6',
|
||||||
xmltv_id: 'DarkMatterTV.us'
|
xmltv_id: 'Heartland.ca'
|
||||||
}
|
}
|
||||||
|
|
||||||
it('can generate valid url', () => {
|
it('can generate valid url', () => {
|
||||||
@@ -23,7 +23,7 @@ it('can generate valid url', () => {
|
|||||||
|
|
||||||
it('can generate valid request headers', () => {
|
it('can generate valid request headers', () => {
|
||||||
expect(request.headers).toMatchObject({
|
expect(request.headers).toMatchObject({
|
||||||
'x-plex-provider-version': '5.1'
|
'x-plex-provider-version': '7.2' // Updated to match config.js
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -36,25 +36,30 @@ it('can parse response', () => {
|
|||||||
return p
|
return p
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Testing first item: "Cowgirls Don’t Cry"
|
||||||
expect(results[0]).toMatchObject({
|
expect(results[0]).toMatchObject({
|
||||||
title: 'The Nanny',
|
title: 'Heartland',
|
||||||
subTitle: "Yetta's Lettas",
|
subTitle: 'Cowgirls Don’t Cry',
|
||||||
description: expect.stringContaining('Maxwell battles an old rival'),
|
description: expect.stringContaining('Tim ouvre une école de rodéo'),
|
||||||
image: expect.stringContaining('http')
|
rating: 'TV-PG',
|
||||||
|
season: 8,
|
||||||
|
episode: 13,
|
||||||
|
date: '2015-02-15'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Testing another item: "Riders on the Storm"
|
||||||
expect(results[1]).toMatchObject({
|
expect(results[1]).toMatchObject({
|
||||||
title: 'The Nanny',
|
title: 'Heartland',
|
||||||
subTitle: 'The Baby Shower',
|
subTitle: 'Riders on the Storm',
|
||||||
description: expect.stringContaining('A psychic predicts that Maxwell'),
|
description: expect.stringContaining('Amy et Ty aident le neveu de Scott'),
|
||||||
season: 6,
|
season: 8,
|
||||||
episode: 20,
|
episode: 14,
|
||||||
image: expect.stringContaining('17nyw13tvyrd61fd9cimazndar.png')
|
image: expect.stringContaining('Heartland_landscape.jpg')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('can handle empty guide', () => {
|
it('can handle empty guide', () => {
|
||||||
const content = fs.readFileSync(path.resolve(__dirname, '__data__/no_content.json'))
|
const content = JSON.stringify({ MediaContainer: { Metadata: [] } })
|
||||||
const results = parser({ content })
|
const results = parser({ content })
|
||||||
|
|
||||||
expect(results).toMatchObject([])
|
expect(results).toMatchObject([])
|
||||||
@@ -67,19 +72,9 @@ it('can parse channel list', async () => {
|
|||||||
MediaContainer: {
|
MediaContainer: {
|
||||||
Channel: [
|
Channel: [
|
||||||
{
|
{
|
||||||
title: 'The World Poker Tour',
|
title: 'Heartland TV',
|
||||||
gridKey: '5f6b8e7900b0950040d0f2b2',
|
gridKey: 'heartland-key',
|
||||||
id: '5e20b730f2f8d5003d739db7-5f6b8e7900b0950040d0f2b2',
|
id: '12345'
|
||||||
thumb: 'https://provider-static.plex.tv/epg/cms/production/c40e4f88-6f5c-4f2a-8d54-e6812e25771c/wpt_logo.png',
|
|
||||||
Media: [
|
|
||||||
{
|
|
||||||
Part: [
|
|
||||||
{
|
|
||||||
key: '/library/parts/5e20b730f2f8d5003d739db7-5f6b8e7900b0950040d0f2b2.m3u8'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -91,9 +86,7 @@ it('can parse channel list', async () => {
|
|||||||
|
|
||||||
expect(results[0]).toMatchObject({
|
expect(results[0]).toMatchObject({
|
||||||
lang: 'en',
|
lang: 'en',
|
||||||
site_id: '5f6b8e7900b0950040d0f2b2',
|
site_id: 'heartland-key',
|
||||||
name: 'The World Poker Tour',
|
name: 'Heartland TV'
|
||||||
// logo: 'https://provider-static.plex.tv/epg/cms/production/c40e4f88-6f5c-4f2a-8d54-e6812e25771c/wpt_logo.png',
|
|
||||||
// url: 'https://epg.provider.plex.tv/library/parts/5e20b730f2f8d5003d739db7-5f6b8e7900b0950040d0f2b2.m3u8?X-Plex-Token=TEST_TOKEN'
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user