Restore dates to browse page.

This commit is contained in:
Edward Betts 2019-09-30 19:57:17 +01:00
parent c096a8fa6e
commit c79427f794

View file

@ -100,6 +100,7 @@ def build_browse_item_map(bindings):
filenames = set() filenames = set()
artist_names = [] artist_names = []
labels = set() labels = set()
when = None
for item in items: for item in items:
if 'title' in item: if 'title' in item:
lang, title = item['title'] lang, title = item['title']
@ -110,12 +111,15 @@ def build_browse_item_map(bindings):
artist_names.append(artist_name) artist_names.append(artist_name)
if 'label' in item: if 'label' in item:
labels.add(item['label']) labels.add(item['label'])
if when is None and item.get('date'):
when = item['date']
item = { item = {
'qid': f'Q{item_id}', 'qid': f'Q{item_id}',
'item_id': item_id, 'item_id': item_id,
'image_filename': list(filenames), 'image_filename': list(filenames),
'artist_name': ', '.join(artist_names), 'artist_name': ', '.join(artist_names),
'date': when,
} }
if artist_names: if artist_names:
item['artist_name'] = ', '.join(artist_names) item['artist_name'] = ', '.join(artist_names)