def get_producer_altids(self):
"""
- Get the alternate ids of producers if any
+ Get the alternate ids of producers / chains if any
"""
by_names = defaultdict(list)
for attr in self.session['children']:
- if 'producer' in self.get_name(attr) and 'children' in attr:
+ name = self.get_name(attr)
+ if ('producer' in name or 'chain' in name) and 'children' in attr:
if "id" in attr['attributes']:
entry_id = attr['attributes']['id']
for att in attr['children']:
name = self.get_name(att['attributes'])
if 'resource' in name and 'cdata' in att:
- by_names[att['cdata']].append(entry_id)
+ by_names[att['cdata']].append(entry_id)
alt_ids = {}
for vals in by_names.values():
return rel_time
for attr in self.session['children']:
- if 'playlist' in self.get_name(attr) and 'children' in attr:
+ name = self.get_name(attr)
+ if 'playlist' in name and 'children' in attr:
# Old v 6.4 file format, markers in playlist
for att in attr['children']:
if 'name' in att['attributes']:
if rel_time is not None:
#print(comment, entry_id, marker_time, rel_time)
add_marker(rel_time, comment)
- elif 'producer' in self.get_name(attr) and 'children' in attr:
+ elif ('producer' in name or 'chain' in name) and 'children' in attr:
# New v 6.24 file format, markers in producers
+ # Also new v 7.30 file format, markers in chains
if "id" in attr['attributes']:
entry_id = attr['attributes']['id']
alt_ids = alternate_ids.get(entry_id, [])