more places where year might not exist, fixes #2778

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

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