diff --git a/sites/tvtv.us/tvtv.us.config.js b/sites/tvtv.us/tvtv.us.config.js index 6767ccd2..c845c0f2 100644 --- a/sites/tvtv.us/tvtv.us.config.js +++ b/sites/tvtv.us/tvtv.us.config.js @@ -54,13 +54,15 @@ module.exports = { channel = { site_id: station.id, name: stationData.name, - xmltv_id: parseChannelId(stationData) + xmltv_id: parseChannelId(stationData), + logo: parseChannelIcon(item) } break default: channel = { site_id: station.id, - name: stationData.name + name: stationData.name, + logo: parseChannelIcon(item) } break } @@ -125,3 +127,9 @@ function parseIcon(item) { ? `https://tvtv.us/gn/i/${item.program.preferredImage.uri}` : null } + +function parseChannelIcon(item) { + return item.station.preferredImage && item.station.preferredImage.uri + ? `https://tvtv.us/gn/i/${item.station.preferredImage.uri}` + : null +} diff --git a/sites/tvtv.us/tvtv.us.test.js b/sites/tvtv.us/tvtv.us.test.js index 2153da64..c78a7f98 100644 --- a/sites/tvtv.us/tvtv.us.test.js +++ b/sites/tvtv.us/tvtv.us.test.js @@ -11,7 +11,8 @@ dayjs.extend(utc) const date = dayjs.utc('2022-01-17', 'YYYY-MM-DD').startOf('d') const channel = { site_id: '62670', - xmltv_id: 'AMITV.ca' + xmltv_id: 'AMITV.ca', + logo: 'https://tvtv.us/gn/i/assets/s62670_ll_h15_ab.png?w=360&h=270' } it('can generate valid url', () => {