diff --git a/static/js/item.js b/static/js/item.js
index adf81984..32c05f6b 100644
--- a/static/js/item.js
+++ b/static/js/item.js
@@ -34,13 +34,7 @@ pandora.ui.item = function() {
}
pandora.$ui.itemTitle
- .options({
- title: '' + result.data.title
- + (Ox.len(result.data.director)
- ? ' (' + result.data.director.join(', ') + ')'
- : '')
- + (result.data.year ? ' ' + result.data.year : '') + ''
- })
+ .options({title: '' + pandora.getItemTitle(result.data) + ''})
.show();
// fixme: layers have value, subtitles has text?
diff --git a/static/js/utils.js b/static/js/utils.js
index 7f832cc6..0d61a7ab 100644
--- a/static/js/utils.js
+++ b/static/js/utils.js
@@ -822,17 +822,7 @@ pandora.getClipVideos = function(clip, resolution) {
pandora.getDocumentTitle = function(itemData) {
var parts = [pandora.site.site.name];
if (itemData) {
- itemTitles[pandora.user.ui.item] = Ox.decodeHTMLEntities(
- (itemData.title || Ox._('Untitled')) + (
- Ox.len(itemData.director) || itemData.year
- ? ' (' + (
- Ox.len(itemData.director)
- ? itemData.director
- : [Ox._('Unknown Director')]
- ).join(', ') + ')'
- : ''
- ) + (itemData.year ? ' ' + itemData.year : '')
- );
+ itemTitles[pandora.user.ui.item] = Ox.decodeHTMLEntities(pandora.getItemTitle(itemData));
}
if (pandora.user.ui.section == 'items') {
if (!pandora.user.ui.item) {
@@ -1120,6 +1110,18 @@ pandora.getItemIdAndPosition = function() {
return ret;
}
+pandora.getItemTitle = function(itemData) {
+ return (itemData.title || Ox._('Untitled')) + (
+ Ox.len(itemData.director) || itemData.year
+ ? ' (' + (
+ Ox.len(itemData.director)
+ ? itemData.director
+ : [Ox._('Unknown Director')]
+ ).join(', ') + ')'
+ : ''
+ ) + (itemData.year ? ' ' + itemData.year : '')
+};
+
pandora.getLargeClipTimelineURL = function(item, inPoint, outPoint, type, callback) {
var fps = 25,
width = Math.floor((outPoint - inPoint) * fps),