e2openplugin-OpenWebif icon indicating copy to clipboard operation
e2openplugin-OpenWebif copied to clipboard

`getEvent` sometimes returns `None` for start and end times.

Open wedebe opened this issue 3 years ago • 7 comments

Describe the bug getEvent sometimes returns None for start and end times.

To Reproduce Steps to reproduce the behavior: In modern interface, click on the current program name. Sometimes, the modal doesn't populate, even for the same event, and even when it's currently being broadcast. The api returns

/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/models/services.py:762 in getEvent
761 info['begin'] = event[1]
762 info['end'] = strftime("%H:%M", (localtime(event[1] + event[2])))
763 info['duration'] = event[2]
builtins.TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

/ajax/event?idev=194&sref=1%3A0%3A1%3A178F%3A7D7%3A2%3A11A0000%3A0%3A0%3A0%3A

Expected behavior Event details modal should either populate, or show Event details no longer available. (when that applies).

Additional context I planned to implement a workaround in services.py#L752 , but feel this would cover up an underlying bug.

wedebe avatar Apr 02 '22 11:04 wedebe

Several hours later, the url returns a similar server error

/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/ajax.py:97 in P_event
96 def P_event(self, request):
97 event = getEvent(getUrlArg(request, "sref"), getUrlArg(request, "idev"))
98 event['event']['recording_margin_before'] = config.recording.margin_before.value

/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/models/services.py:774 in getEvent
773 info['picon'] = getPicon(event[7])
774 info['timer'] = getTimerEventStatus(event, eventLookupTable, None)
775 info['link'] = getIPTVLink(event[7])

/usr/lib/enigma2/python/Plugins/Extensions/OpenWebif/controllers/models/services.py:720 in getTimerEventStatus
719 startTime = event[eventLookupTable.index('B')]
720 endTime = event[eventLookupTable.index('B')] + event[eventLookupTable.index('D')] - 120
721 serviceref = event[eventLookupTable.index('R')]
builtins.TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'

wedebe avatar Apr 02 '22 17:04 wedebe

You need to add this after line 709

	if startTime is None:
		return None

jbleyel avatar Apr 02 '22 18:04 jbleyel

BUT !! lookupEvent should always return start time and duration otherwise you have corrupted epg data.

jbleyel avatar Apr 02 '22 18:04 jbleyel

BUT !! lookupEvent should always return start time and duration otherwise you have corrupted epg data.

Yep, this happens regularly, even on clean installs. Possibly an EPGCache issue.

wedebe avatar Apr 08 '22 09:04 wedebe

Do you use any external epg data source?

jbleyel avatar Apr 08 '22 10:04 jbleyel

Do you use any external epg data source?

Nope, just the default EPG source options set by OpenATV (I can't access my box at the moment to verify which ones are selected). Astra2 Ireland/United Kingdom channels.

wedebe avatar Apr 08 '22 10:04 wedebe

wedebe avatar Apr 20 '22 10:04 wedebe