mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 00:55:50 +00:00
Added icon for channel.
This commit is contained in:
parent
990a9ec7b7
commit
fc92a1034f
1 changed files with 13 additions and 0 deletions
|
|
@ -91,6 +91,19 @@ def generate_epg(request, profile_name=None):
|
|||
display_name = channel.epg_data.name if channel.epg_data else channel.name
|
||||
xml_lines.append(f' <channel id="{channel_id}">')
|
||||
xml_lines.append(f' <display-name>{display_name}</display-name>')
|
||||
|
||||
# Add channel logo if available
|
||||
if channel.logo:
|
||||
# Use the full URL for the logo
|
||||
base_url = request.build_absolute_uri('/')[:-1]
|
||||
logo_url = channel.logo.url
|
||||
|
||||
# Convert to absolute URL if it's relative
|
||||
if logo_url.startswith('/'):
|
||||
logo_url = f"{base_url}{logo_url}"
|
||||
|
||||
xml_lines.append(f' <icon src="{logo_url}" />')
|
||||
|
||||
xml_lines.append(' </channel>')
|
||||
|
||||
for channel in channels:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue