From 58a6cdedf772ec6b3e2ea7c7ebdfb598b309b780 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Fri, 12 Dec 2025 17:23:02 -0600 Subject: [PATCH] Bug Fix: Fix handling of None values in xc_get_epg output to prevent AttributeError when title and/or description are none. --- CHANGELOG.md | 1 + apps/output/views.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68e263be..26242296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - nginx now gracefully handles hosts without IPv6 support by automatically disabling IPv6 binding at startup - XtreamCodes EPG API now returns correct date/time format for start/end fields and proper string types for timestamps and channel_id +- XtreamCodes EPG API now handles None values for title and description fields to prevent AttributeError ## [0.14.0] - 2025-12-09 diff --git a/apps/output/views.py b/apps/output/views.py index dc1e4327..2f8eac3b 100644 --- a/apps/output/views.py +++ b/apps/output/views.py @@ -2303,11 +2303,11 @@ def xc_get_epg(request, user, short=False): program_output = { "id": f"{id}", "epg_id": f"{epg_id}", - "title": base64.b64encode(title.encode()).decode(), + "title": base64.b64encode((title or "").encode()).decode(), "lang": "", "start": start.strftime("%Y-%m-%d %H:%M:%S"), "end": end.strftime("%Y-%m-%d %H:%M:%S"), - "description": base64.b64encode(description.encode()).decode(), + "description": base64.b64encode((description or "").encode()).decode(), "channel_id": str(channel_num_int), "start_timestamp": str(int(start.timestamp())), "stop_timestamp": str(int(end.timestamp())),