forked from 0x2620/pandora
include more metadata in non-js page, fixes #1876
This commit is contained in:
parent
303662fb27
commit
d4ff2b60ef
2 changed files with 29 additions and 5 deletions
|
@ -1221,16 +1221,40 @@ def item(request, id):
|
||||||
keys = [
|
keys = [
|
||||||
'year',
|
'year',
|
||||||
'director',
|
'director',
|
||||||
|
'writer',
|
||||||
|
'producer',
|
||||||
|
'cinematographer',
|
||||||
|
'editor',
|
||||||
|
'actor',
|
||||||
'topic',
|
'topic',
|
||||||
'summary'
|
|
||||||
]
|
]
|
||||||
|
if not settings.USE_IMDB:
|
||||||
|
keys += [
|
||||||
|
'summary'
|
||||||
|
]
|
||||||
|
keys += [
|
||||||
|
'duration'
|
||||||
|
'aspectratio'
|
||||||
|
'hue',
|
||||||
|
'saturation',
|
||||||
|
'lightness',
|
||||||
|
'volume',
|
||||||
|
'numberofcuts',
|
||||||
|
]
|
||||||
|
|
||||||
data = []
|
data = []
|
||||||
for key in keys:
|
for id in keys:
|
||||||
value = item.get(key)
|
value = item.get(id)
|
||||||
|
key = utils.get_by_id(settings.CONFIG['itemKeys'], id)
|
||||||
if value:
|
if value:
|
||||||
|
title = key['title'] if key else id.capitalize()
|
||||||
if isinstance(value, list):
|
if isinstance(value, list):
|
||||||
value = value = u', '.join([unicode(v) for v in value])
|
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 = []
|
clips = []
|
||||||
clip = {'in': 0, 'annotations': []}
|
clip = {'in': 0, 'annotations': []}
|
||||||
#logged in users should have javascript. not adding annotations makes load faster
|
#logged in users should have javascript. not adding annotations makes load faster
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<div style="padding: 16px 0 8px 0; font-weight: bold; font-size: 13px">{{title}}</div>
|
<div style="padding: 16px 0 8px 0; font-weight: bold; font-size: 13px">{{title}}</div>
|
||||||
{% for i in data %}
|
{% for i in data %}
|
||||||
<div style="text-align: justify">
|
<div style="text-align: justify">
|
||||||
<b>{{i.key}}</b>: {{i.value|safe}}
|
<b>{{i.title}}</b>: {{i.value|safe}}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for c in clips %}
|
{% for c in clips %}
|
||||||
|
|
Loading…
Reference in a new issue