mirror of
https://github.com/iptv-org/iptv.git
synced 2026-11-25 01:30:37 +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 }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user