more places where year might not exist, fixes #2778

This commit is contained in:
j 2015-05-19 17:47:20 +05:30
parent 09c3c4b959
commit 380185efd4
2 changed files with 10 additions and 4 deletions

View file

@ -190,7 +190,7 @@ pandora.ui.list = function() {
) + size + '.jpg?' + data.modified),
format, info, sortKey = sort[0].key;
if (['title', 'director'].indexOf(sortKey) > -1) {
info = data['year'];
info = data['year'] || data['date'] || '';
} else {
format = pandora.getSortKeyData(sortKey).format;
if (format) {
@ -277,7 +277,7 @@ pandora.ui.list = function() {
) + size + '.jpg?' + data.modified),
format, info, sortKey = sort[0].key;
if (['title', 'director'].indexOf(sortKey) > -1) {
info = data['year'];
info = data['year'] || data['date'] || '';
} else {
format = pandora.getSortKeyData(sortKey).format;
if (format) {

View file

@ -459,11 +459,17 @@ pandora.ui.listIconPanel = function(listData) {
$list = Ox.IconList({
borderRadius: 16,
item: function(data, sort) {
var size = 128;
var infoKey = ['title', 'director'].indexOf(sort[0].key) > -1
? pandora.site.itemKeys.filter(function(key) {
return ['year', 'date'].indexOf(key.id) > -1
}).map(function(key) {
return key.id;
})[0] : sort[0],key,
size = 128;
return {
height: size,
id: data.id,
info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key],
info: data[infoKey] || '',
title: pandora.getItemTitle(data),
url: pandora.getMediaURL('/' + data.id + '/icon' + size + '.jpg?' + data.modified),
width: size