pandora/static/js/getItemTitle.js
2025-01-24 14:55:58 +05:30

17 lines
537 B
JavaScript

'use strict';
pandora.getItemTitle = function(itemData, includeYear) {
var director = itemData.director
if (!Ox.isArray(director)) {
director = [director]
}
return (itemData.title || Ox._('Untitled')) + (
Ox.len(itemData.director) || (includeYear && itemData.year)
? ' (' + (
Ox.len(itemData.director)
? itemData.director
: [Ox._('Unknown Director')]
).join(', ') + ')'
: ''
) + (includeYear && itemData.year ? ' ' + itemData.year : '')
};