From c79427f794af552b697d45b1cbcf98aef30168c4 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 30 Sep 2019 19:57:17 +0100 Subject: [PATCH] Restore dates to browse page. --- depicts/wdqs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depicts/wdqs.py b/depicts/wdqs.py index ab377fc..224982d 100644 --- a/depicts/wdqs.py +++ b/depicts/wdqs.py @@ -100,6 +100,7 @@ def build_browse_item_map(bindings): filenames = set() artist_names = [] labels = set() + when = None for item in items: if 'title' in item: lang, title = item['title'] @@ -110,12 +111,15 @@ def build_browse_item_map(bindings): artist_names.append(artist_name) if 'label' in item: labels.add(item['label']) + if when is None and item.get('date'): + when = item['date'] item = { 'qid': f'Q{item_id}', 'item_id': item_id, 'image_filename': list(filenames), 'artist_name': ', '.join(artist_names), + 'date': when, } if artist_names: item['artist_name'] = ', '.join(artist_names)