Merge pull request #2703 from Aandree5/nostv-icon-image

feat: added icon tag to xml export for nostv
This commit is contained in:
PopeyeTheSai10r 2025-03-05 18:25:50 -08:00 committed by GitHub
commit 0044f19615
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 10 deletions

View file

@ -19,8 +19,7 @@ module.exports = {
site: 'nostv.pt',
days: 2,
url({ channel, date }) {
return `https://api.clg.nos.pt/nostv/ott/schedule/range/contents/guest?channels=${
channel.site_id
return `https://api.clg.nos.pt/nostv/ott/schedule/range/contents/guest?channels=${channel.site_id
}&minDate=${date.format('YYYY-MM-DD')}T00:00:00Z&maxDate=${date.format(
'YYYY-MM-DD'
)}T23:59:59Z&isDateInclusive=true&client_id=${headers['X-Apikey']}`
@ -31,15 +30,19 @@ module.exports = {
if (content) {
const items = Array.isArray(content) ? content : JSON.parse(content)
items.forEach(item => {
const image = item.Images
? `https://mage.stream.nos.pt/mage/v1/Images?sourceUri=${item.Images[0].Url}&profile=ott_1_452x340&client_id=${headers['X-Apikey']}`
: null
programs.push({
title: item.Metadata?.Title,
sub_title: item.Metadata?.SubTitle ? item.Metadata?.SubTitle : null,
description: item.Metadata?.Description,
season: item.Metadata?.Season,
episode: item.Metadata?.Episode,
image: item.Images
? `https://mage.stream.nos.pt/v1/nostv_mage/Images?sourceUri=${item.Images[0].Url}&profile=ott_1_452x340&client_id=${headers['X-Apikey']}`
: null,
icon: {
src: image
},
image,
start: dayjs.utc(item.UtcDateTimeStart),
stop: dayjs.utc(item.UtcDateTimeEnd)
})

View file

@ -28,6 +28,8 @@ it('can parse response', () => {
return p
})
const image = 'https://mage.stream.nos.pt/mage/v1/Images?sourceUri=http://vip.pam.local.internal/PAM.Images/Store/8329ed1aec5d4c0faa2056972256ff9f&profile=ott_1_452x340&client_id=xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI'
expect(results[0]).toMatchObject({
start: '2023-12-11T16:30:00.000Z',
stop: '2023-12-11T17:00:00.000Z',
@ -36,8 +38,10 @@ it('can parse response', () => {
'A história de dois melhores amigos veterinários e o seu extraordinário trabalho na Austrália.',
season: 1,
episode: 12,
image:
'https://mage.stream.nos.pt/v1/nostv_mage/Images?sourceUri=http://vip.pam.local.internal/PAM.Images/Store/8329ed1aec5d4c0faa2056972256ff9f&profile=ott_1_452x340&client_id=xe1dgrShwdR1DVOKGmsj8Ut4QLlGyOFI'
icon: {
src: image
},
image
})
})