forked from 0x2620/pandora
more places where year might not exist, fixes #2778
This commit is contained in:
parent
09c3c4b959
commit
380185efd4
2 changed files with 10 additions and 4 deletions
|
@ -190,7 +190,7 @@ pandora.ui.list = function() {
|
||||||
) + size + '.jpg?' + data.modified),
|
) + size + '.jpg?' + data.modified),
|
||||||
format, info, sortKey = sort[0].key;
|
format, info, sortKey = sort[0].key;
|
||||||
if (['title', 'director'].indexOf(sortKey) > -1) {
|
if (['title', 'director'].indexOf(sortKey) > -1) {
|
||||||
info = data['year'];
|
info = data['year'] || data['date'] || '';
|
||||||
} else {
|
} else {
|
||||||
format = pandora.getSortKeyData(sortKey).format;
|
format = pandora.getSortKeyData(sortKey).format;
|
||||||
if (format) {
|
if (format) {
|
||||||
|
@ -277,7 +277,7 @@ pandora.ui.list = function() {
|
||||||
) + size + '.jpg?' + data.modified),
|
) + size + '.jpg?' + data.modified),
|
||||||
format, info, sortKey = sort[0].key;
|
format, info, sortKey = sort[0].key;
|
||||||
if (['title', 'director'].indexOf(sortKey) > -1) {
|
if (['title', 'director'].indexOf(sortKey) > -1) {
|
||||||
info = data['year'];
|
info = data['year'] || data['date'] || '';
|
||||||
} else {
|
} else {
|
||||||
format = pandora.getSortKeyData(sortKey).format;
|
format = pandora.getSortKeyData(sortKey).format;
|
||||||
if (format) {
|
if (format) {
|
||||||
|
|
|
@ -459,11 +459,17 @@ pandora.ui.listIconPanel = function(listData) {
|
||||||
$list = Ox.IconList({
|
$list = Ox.IconList({
|
||||||
borderRadius: 16,
|
borderRadius: 16,
|
||||||
item: function(data, sort) {
|
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 {
|
return {
|
||||||
height: size,
|
height: size,
|
||||||
id: data.id,
|
id: data.id,
|
||||||
info: data[['title', 'director'].indexOf(sort[0].key) > -1 ? 'year' : sort[0].key],
|
info: data[infoKey] || '',
|
||||||
title: pandora.getItemTitle(data),
|
title: pandora.getItemTitle(data),
|
||||||
url: pandora.getMediaURL('/' + data.id + '/icon' + size + '.jpg?' + data.modified),
|
url: pandora.getMediaURL('/' + data.id + '/icon' + size + '.jpg?' + data.modified),
|
||||||
width: size
|
width: size
|
||||||
|
|
Loading…
Reference in a new issue