diff --git a/scripts/models/stream.ts b/scripts/models/stream.ts index 82afe16c95..629efe36b0 100644 --- a/scripts/models/stream.ts +++ b/scripts/models/stream.ts @@ -403,10 +403,13 @@ export class Stream extends sdk.Models.Stream { } getLogos(): Collection { - const logos = super.getLogos() + let logos = super.getLogos() if (logos.isEmpty()) return new Collection() + const logosInUse = logos.filter((logo: sdk.Models.Logo) => logo.in_use) + if (logosInUse.isNotEmpty()) logos = logosInUse + function format(logo: sdk.Models.Logo): number { const levelByFormat = { SVG: 0, PNG: 3, APNG: 1, WebP: 1, AVIF: 1, JPEG: 2, GIF: 1 } diff --git a/tests/__data__/input/data/logos.json b/tests/__data__/input/data/logos.json index 185c63546b..b60b522e25 100644 --- a/tests/__data__/input/data/logos.json +++ b/tests/__data__/input/data/logos.json @@ -5,6 +5,7 @@ {"channel":"BBCNews.uk","feed":null,"tags":[],"width":512,"height":512,"format":"PNG","url":"https://raw.githubusercontent.com/Tapiosinn/tv-logos/master/countries/united-kingdom/bbc-news-uk.png"}, {"channel":"DunaWorld.hu","feed":null,"tags":[],"width":512,"height":512,"format":"PNG","url":"https://i.imgur.com/uOBQJZS.png"}, {"channel":"VisitXTV.nl","feed":null,"tags":[],"width":512,"height":512,"format":"JPEG","url":"https://i.imgur.com/RJ9wbNF.jpg"}, + {"channel":"AndorraTV.ad","feed":null,"in_use":false,"tags":[],"width":512,"height":512,"format":"PNG","url":"https://i.imgur.com/DnhTn8i.png"}, {"channel":"AndorraTV.ad","feed":"SD","tags":[],"width":512,"height":512,"format":"PNG","url":"https://i.imgur.com/BnhTn8i.png"}, {"channel":"AndorraTV.ad","feed":null,"tags":[],"width":1000,"height":1000,"format":"JPEG","url":"https://i.imgur.com/AnhTn8i.png"}, {"channel":"AndorraTV.ad","feed":null,"tags":[],"width":512,"height":512,"format":"PNG","url":"https://i.imgur.com/CnhTn8i.png"},