MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _programme_to_dict

Function _programme_to_dict

apps/epg/tasks.py:4472–4483  ·  view source on GitHub ↗

Convert a lxml element to a serializable dict.

(elem, start_time, end_time)

Source from the content-addressed store, hash-verified

4470
4471
4472def _programme_to_dict(elem, start_time, end_time):
4473 """Convert a <programme> lxml element to a serializable dict."""
4474 title_el = elem.find('title')
4475 desc_el = elem.find('desc')
4476 sub_el = elem.find('sub-title')
4477 return {
4478 'title': title_el.text if title_el is not None and title_el.text else '',
4479 'description': desc_el.text if desc_el is not None and desc_el.text else '',
4480 'sub_title': sub_el.text if sub_el is not None and sub_el.text else '',
4481 'start_time': start_time.isoformat(),
4482 'end_time': end_time.isoformat(),
4483 }
4484
4485
4486def build_programme_index(source_id):

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected