mirror of
https://github.com/Free-TV/IPTV.git
synced 2026-10-23 00:04:59 +02:00
Omit tvg-id attribute when EPG column is empty instead of emitting tvg-id=""
42 channels across 14 lists have an EPG column in their markdown table row but the column is blank. The condition in Channel.to_m3u_line() only checked for None (no EPG column at all) but not for an empty string, so these channels got a tvg-id="" attribute in the generated playlist. An empty tvg-id tells IPTV players "this channel has an EPG ID and it is the empty string", which prevents EPG matching rather than falling back to name-based matching the way a missing attribute would. Changing `if self.epg is not None` to `if self.epg` makes both None and empty string omit the attribute, matching the existing pattern used by the chno and country_code attributes on the lines just above.
This commit is contained in:
+1
-1
@@ -123,7 +123,7 @@ class Channel: # pylint: disable=too-few-public-methods,too-many-instance-attri
|
||||
"""Render this channel as a #EXTINF entry followed by its URL."""
|
||||
country = f' tvg-country="{self.country_code}"' if self.country_code else ""
|
||||
chno = f' tvg-chno="{self.chno}"' if self.chno else ""
|
||||
epg = f' tvg-id="{self.epg}"' if self.epg is not None else ""
|
||||
epg = f' tvg-id="{self.epg}"' if self.epg else ""
|
||||
# Strip trailing in-list markers (Ⓖ/Ⓢ/Ⓨ/...) from tvg-name so EPG
|
||||
# matching isn't broken by a symbol meant for human readers.
|
||||
tvg_name = re.sub(r'\s*[Ⓐ-ⓩ]+\s*$', '', self.name)
|
||||
|
||||
Reference in New Issue
Block a user