diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 165cde40bd..e02bbc7e38 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -1194,7 +1194,7 @@ a.itemTag:hover { } -.itemsContainer .itemsListview { +.itemsContainer:not(.fullWidthItemsContainer) .itemsListview { max-width: 800px; } diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index d033080dd2..1a65bb2b34 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -171,7 +171,9 @@
-
+
+
+
diff --git a/dashboard-ui/scripts/itembynamedetailpage.js b/dashboard-ui/scripts/itembynamedetailpage.js index ded32ceea7..d7f12c6db6 100644 --- a/dashboard-ui/scripts/itembynamedetailpage.js +++ b/dashboard-ui/scripts/itembynamedetailpage.js @@ -424,7 +424,8 @@ html = LibraryBrowser.getListViewHtml({ items: result.Items, smallIcon: true, - playFromHere: true + playFromHere: true, + defaultAction: 'playallfromhere' }); } diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index fe789830b6..8db46db1a8 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -433,8 +433,12 @@ attributes.push(createAttribute("Camera model", item.CameraModel)); } - if (item.Software) { - attributes.push(createAttribute("Software", item.Software)); + if (item.Altitude) { + attributes.push(createAttribute("Altitude", item.Altitude.toFixed(1))); + } + + if (item.Aperture) { + attributes.push(createAttribute("Aperture", 'F' + item.Aperture.toFixed(1))); } if (item.ExposureTime) { @@ -448,16 +452,28 @@ attributes.push(createAttribute("Focal length", item.FocalLength.toFixed(1) + ' mm')); } - if (item.Aperture) { - attributes.push(createAttribute("Aperture", 'F' + item.Aperture.toFixed(1))); + if (item.ImageOrientation) { + attributes.push(createAttribute("Orientation", item.ImageOrientation)); + } + + if (item.IsoSpeedRating) { + attributes.push(createAttribute("Iso Speed Rating", item.IsoSpeedRating)); + } + + if (item.Latitude) { + attributes.push(createAttribute("Latitude", item.Latitude.toFixed(1))); + } + + if (item.Longitude) { + attributes.push(createAttribute("Longitude", item.Longitude.toFixed(1))); } if (item.ShutterSpeed) { attributes.push(createAttribute("ShutterSpeed", item.ShutterSpeed)); } - if (item.ImageOrientation) { - attributes.push(createAttribute("Orientation", item.ImageOrientation)); + if (item.Software) { + attributes.push(createAttribute("Software", item.Software)); } html += attributes.join('
'); @@ -691,8 +707,11 @@ } } + var _childrenItemsQuery = null; function renderChildren(page, item, user, context) { + _childrenItemsQuery = null; + var fields = "ItemCounts,AudioInfo,PrimaryImageAspectRatio"; var query = { @@ -726,69 +745,69 @@ }); } + _childrenItemsQuery = query; promise = promise || ApiClient.getItems(Dashboard.getCurrentUserId(), query); promise.done(function (result) { + var html = ''; + if (item.Type == "MusicAlbum") { - $('#childrenContent', page).html(LibraryBrowser.getListViewHtml({ + html = LibraryBrowser.getListViewHtml({ items: result.Items, smallIcon: true, showIndex: true, index: 'disc', - showIndexNumber: true + showIndexNumber: true, + playFromHere: true, + defaultAction: 'playallfromhere' + }); - })).trigger('create').createCardMenus(); + } + else if (item.Type == "Series") { + html = LibraryBrowser.getPosterViewHtml({ + items: result.Items, + shape: "detailPagePortrait", + showTitle: false, + centerText: true, + context: context, + overlayText: true + }); + } + else if (item.Type == "Season") { + html = LibraryBrowser.getPosterViewHtml({ + items: result.Items, + shape: "detailPage169", + showTitle: true, + displayAsSpecial: item.Type == "Season" && item.IndexNumber, + context: context, + overlayText: true + }); + } + else if (item.Type == "GameSystem") { + html = LibraryBrowser.getPosterViewHtml({ + items: result.Items, + shape: "auto", + showTitle: true, + centerText: true, + context: context + }); + } - } else { + $('.childrenItemsContainer', page).html(html).trigger('create').createCardMenus(); - var html = ''; + if (item.Type == "BoxSet") { - if (item.Type == "Series") { - html = LibraryBrowser.getPosterViewHtml({ - items: result.Items, - shape: "detailPagePortrait", - showTitle: false, - centerText: true, - context: context, - overlayText: true - }); - } - else if (item.Type == "Season") { - html = LibraryBrowser.getPosterViewHtml({ - items: result.Items, - shape: "detailPage169", - showTitle: true, - displayAsSpecial: item.Type == "Season" && item.IndexNumber, - context: context, - overlayText: true - }); - } - else if (item.Type == "GameSystem") { - html = LibraryBrowser.getPosterViewHtml({ - items: result.Items, - shape: "auto", - showTitle: true, - centerText: true, - context: context - }); - } + var collectionItemTypes = [ + { name: 'Movies', type: 'Movie' }, + { name: 'Series', type: 'Series' }, + { name: 'Albums', type: 'MusicAlbum' }, + { name: 'Games', type: 'Game' }, + { name: 'Books', type: 'Book' } + ]; - $('#childrenContent', page).html(html).trigger('create').createCardMenus(); - - if (item.Type == "BoxSet") { - - var collectionItemTypes = [ - { name: 'Movies', type: 'Movie' }, - { name: 'Series', type: 'Series' }, - { name: 'Albums', type: 'MusicAlbum' }, - { name: 'Games', type: 'Game' }, - { name: 'Books', type: 'Book' } - ]; - - renderCollectionItems(page, collectionItemTypes, result.Items, user, context); - } + renderCollectionItems(page, collectionItemTypes, result.Items, user, context); } }); @@ -1521,6 +1540,16 @@ }); }); + $('.childrenItemsContainer', page).on('playallfromhere', function (e, index) { + + LibraryBrowser.playAllFromHere(_childrenItemsQuery, index); + + }).on('queueallfromhere', function (e, index) { + + LibraryBrowser.queueAllFromHere(_childrenItemsQuery, index); + + }); + }).on('pageshow', "#itemDetailPage", function () { var page = this; diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 1f5f49cf22..b7a5f532b9 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -601,8 +601,12 @@ cssClass += ' ' + LibraryBrowser.getUserDataCssClass(item.UserData.Key); } + var href = LibraryBrowser.getHref(item, options.context); - html += '
  • '; + html += '
  • '; + + var onclick = options.defaultAction ? (' data-action="' + options.defaultAction + '" class="itemWithAction"') : ''; + html += ''; var imgUrl; diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index 3009c526a5..aa92cfa984 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -723,6 +723,28 @@ PlaylistManager.showPanel(selection); } + function onItemWithActionClick() { + + var elem = this; + var action = elem.getAttribute('data-action'); + var itemId = elem.parentNode.getAttribute('data-itemid'); + + if (action == 'play') { + MediaController.play(itemId); + } + else if (action == 'playallfromhere') { + + var index = elem.parentNode.getAttribute('data-index'); + var itemsContainer = $(elem).parents('.itemsContainer'); + + closeContextMenu(); + + itemsContainer.trigger('playallfromhere', [index]); + } + + return false; + } + $(document).on('pageinit', ".libraryPage", function () { var page = this; @@ -762,6 +784,7 @@ toggleSelections(page); }); + $('.itemWithAction', this).on('click', onItemWithActionClick); }); }).on('pagebeforeshow', ".libraryPage", function () { diff --git a/dashboard-ui/scripts/playlistedit.js b/dashboard-ui/scripts/playlistedit.js index 3063bcf2e0..22748cc7f0 100644 --- a/dashboard-ui/scripts/playlistedit.js +++ b/dashboard-ui/scripts/playlistedit.js @@ -76,7 +76,8 @@ title: item.Name, showRemoveFromPlaylist: true, smallIcon: true, - playFromHere: true + playFromHere: true, + defaultAction: 'playallfromhere' }); } diff --git a/dashboard-ui/scripts/songs.js b/dashboard-ui/scripts/songs.js index 4ce7b094f3..db1a03c8f9 100644 --- a/dashboard-ui/scripts/songs.js +++ b/dashboard-ui/scripts/songs.js @@ -61,7 +61,8 @@ html += LibraryBrowser.getListViewHtml({ items: result.Items, smallIcon: true, - showIndex: true + showIndex: true, + defaultAction: 'play' }); html += pagingHtml;