diff --git a/sites/dstv.com/dstv.com.config.js b/sites/dstv.com/dstv.com.config.js index 64cd2ebb..4c421ee7 100644 --- a/sites/dstv.com/dstv.com.config.js +++ b/sites/dstv.com/dstv.com.config.js @@ -19,21 +19,8 @@ module.exports = { 'YYYY-MM-DD' )}` }, - async logo({ channel }) { - if (channel.logo) return channel.logo - const [bouquetId, channelId] = channel.site_id.split('#') - const url = `https://guide.dstv.com/api/channel/fetchChannelsByGenresInBouquet?bouquetId=${bouquetId}&genre=all` - const result = await axios - .get(url) - .then(r => r.data) - .catch(console.log) - if (!result) return null - const items = result.items || [] - const elem = items.find(i => i.channelTag === channelId) || { - channelLogoPaths: { XLARGE: null } - } - - return elem.channelLogoPaths.XLARGE + logo({ channel }) { + return channel.logo }, parser({ content, date, channel }) { let PM = false diff --git a/sites/dstv.com/dstv.com.test.js b/sites/dstv.com/dstv.com.test.js index b9ff7731..e5b3e536 100644 --- a/sites/dstv.com/dstv.com.test.js +++ b/sites/dstv.com/dstv.com.test.js @@ -24,15 +24,10 @@ it('can generate valid url', () => { ) }) -it('can get logo url', done => { - logo({ channel }) - .then(result => { - expect(result).toBe( - 'https://rndcdn.dstv.com/dstvcms/2020/09/01/M-Net_Movies_4_Logo_4-3_lightbackground_xlrg.png' - ) - done() - }) - .catch(error => done(error)) +it('can get logo url', () => { + expect(logo({ channel })).toBe( + 'https://rndcdn.dstv.com/dstvcms/2020/09/01/M-Net_Movies_4_Logo_4-3_lightbackground_xlrg.png' + ) }) it('can parse response', () => {