mirror of
https://github.com/iptv-org/iptv.git
synced 2026-11-22 08:10:13 +02:00
fix: prefer active logos over not in use
Filter not looking at in_use flag, so old logos may win over new ones. First try to get logo from in use, fallback to not used logos.
This commit is contained in:
@@ -403,10 +403,13 @@ export class Stream extends sdk.Models.Stream {
|
||||
}
|
||||
|
||||
getLogos(): Collection<sdk.Models.Logo> {
|
||||
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 }
|
||||
|
||||
|
||||
@@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user