From d4ff2b60ef06ea691fa0ab1879058fdb96443381 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 11 Jan 2014 09:51:03 +0000 Subject: [PATCH] include more metadata in non-js page, fixes #1876 --- pandora/item/views.py | 32 ++++++++++++++++++++++++++++---- pandora/templates/item.html | 2 +- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/pandora/item/views.py b/pandora/item/views.py index fff30e22..0c1a1454 100644 --- a/pandora/item/views.py +++ b/pandora/item/views.py @@ -1221,16 +1221,40 @@ def item(request, id): keys = [ 'year', 'director', + 'writer', + 'producer', + 'cinematographer', + 'editor', + 'actor', 'topic', - 'summary' ] + if not settings.USE_IMDB: + keys += [ + 'summary' + ] + keys += [ + 'duration' + 'aspectratio' + 'hue', + 'saturation', + 'lightness', + 'volume', + 'numberofcuts', + ] + data = [] - for key in keys: - value = item.get(key) + for id in keys: + value = item.get(id) + key = utils.get_by_id(settings.CONFIG['itemKeys'], id) if value: + title = key['title'] if key else id.capitalize() if isinstance(value, list): value = value = u', '.join([unicode(v) for v in value]) - data.append({'key': key.capitalize(), 'value': value}) + elif key and key.get('type') == 'float': + value = '%0.3f' % value + elif key and key.get('type') == 'time': + value = ox.format_duration(value * 1000) + data.append({'key': id, 'title': title, 'value': value}) clips = [] clip = {'in': 0, 'annotations': []} #logged in users should have javascript. not adding annotations makes load faster diff --git a/pandora/templates/item.html b/pandora/templates/item.html index d2cb23da..c101b2fa 100644 --- a/pandora/templates/item.html +++ b/pandora/templates/item.html @@ -37,7 +37,7 @@