Bug Fix: Fix handling of None values in xc_get_epg output to prevent AttributeError when title and/or description are none.

This commit is contained in:
SergeantPanda 2025-12-12 17:23:02 -06:00
parent dedd898a29
commit 58a6cdedf7
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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())),