Simplify metadata credits marker first flag

This commit is contained in:
JonnyWong16 2023-02-17 09:28:44 -08:00
parent 7cc78d448d
commit 9c6b8f1af5
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -780,17 +780,15 @@ class PmsConnect(object):
for marker in metadata_main.getElementsByTagName('Marker'):
marker_type = helpers.get_xml_attr(marker, 'type')
if marker_type == 'credits':
if first is None:
first = True
elif first is True:
first = False
first = bool(first is None)
final = helpers.bool_true(helpers.get_xml_attr(marker, 'final'))
markers.append({
'id': helpers.cast_to_int(helpers.get_xml_attr(marker, 'id')),
'type': helpers.get_xml_attr(marker, 'type'),
'type': marker_type,
'start_time_offset': helpers.cast_to_int(helpers.get_xml_attr(marker, 'startTimeOffset')),
'end_time_offset': helpers.cast_to_int(helpers.get_xml_attr(marker, 'endTimeOffset')),
'first': first if marker_type == 'credits' else False,
'final': helpers.bool_true(helpers.get_xml_attr(marker, 'final'))
'first': first if marker_type == 'credits' else None,
'final': final if marker_type == 'credits' else None
})
if metadata_type == 'movie':