diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 7ecc0d48c4..0fcb0b2e02 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -114,6 +114,7 @@ .detailPageContent { width: 70%; + max-width: 1200px; } } @@ -251,7 +252,7 @@ } .detailPagePrimaryInfo { - margin: 1em 0 1.5em; + margin: 1em 0; } .scenePosterViewItem img { @@ -297,7 +298,7 @@ @media all and (min-width: 1200px) { .tileItem { - width: 30.6%; + width: 31%; } .scenePosterViewItem img { @@ -314,7 +315,7 @@ @media all and (min-width: 1920px) { .tileItem { - width: 31.3%; + width: 31.5%; } .tileImage { @@ -324,7 +325,7 @@ @media all and (min-width: 2000px) { .tileItem { - width: 23%; + width: 23.5%; } } @@ -337,25 +338,37 @@ .detailTable { border-collapse: collapse; border-spacing: 0; - min-width: 70%; + width: 70%; + max-width: 1200px; } - .detailTable td { - border-spacing: 0; - border-top: 1px solid #444; - border-bottom: 1px solid #444; - padding: 3px 5px; - } +.centeredDetailTable { + margin: auto; +} +.stretchedDetailTable { + width: 100%; +} - .detailTable th { - border-spacing: 0; - border-bottom: 1px solid #444; - padding: 5px; - font-weight: normal; - text-align: left; - } +.detailTable td { + border-spacing: 0; + border-top: 1px solid #444; + border-bottom: 1px solid #444; + padding: 3px 5px; +} - .detailTable .imgUserItemRating { - width: 20px; - height: 20px; - } +.detailTable th { + border-spacing: 0; + border-bottom: 1px solid #444; + padding: 5px; + font-weight: normal; + text-align: left; + vertical-align: top; +} + +.detailTable .imgUserItemRating { + width: 18px; + height: 18px; +} +.userDataCell { + width: 140px; +} \ No newline at end of file diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index fd70772587..a0024e13fd 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -471,7 +471,7 @@ form, .readOnlyContent { bottom: 28px; } -.posterViewItem:hover, .userItem:hover, .posterDetailViewItem:hover { +.posterViewItem:hover, .userItem:hover, .tileItem:hover { -moz-box-shadow: 0 0 20px 3px #2572EB; -webkit-box-shadow: 0 0 20px 3px #2572EB; box-shadow: 0 0 20px 3px #2572EB; @@ -660,6 +660,7 @@ progress { .itemDetailImage { max-width: 100%; + max-height: 400px; } .itemImageBlock { @@ -712,7 +713,7 @@ progress { } .itemDetailImage { - width: 220px; + max-width: 220px; } .itemDetailBlock { @@ -730,7 +731,7 @@ progress { @media all and (min-width: 750px) { .itemDetailImage { - width: 300px; + max-width: 300px; } .itemDetailBlock { @@ -756,7 +757,7 @@ progress { @media all and (min-width: 1440px) { .itemDetailImage { - width: 350px; + max-width: 350px; } .itemDetailBlock { @@ -767,7 +768,7 @@ progress { @media all and (min-width: 1700px) { .itemDetailImage { - width: 400px; + max-width: 400px; } .itemDetailBlock { @@ -778,7 +779,7 @@ progress { @media all and (min-width: 1920px) { .itemDetailBlock { - width: 65%; + width: 63%; } } diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index 65b2c604cd..d204166132 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -111,8 +111,9 @@ +
-
+

diff --git a/dashboard-ui/musicalbums.html b/dashboard-ui/musicalbums.html index b2a2ac7ff9..e65425782d 100644 --- a/dashboard-ui/musicalbums.html +++ b/dashboard-ui/musicalbums.html @@ -10,7 +10,7 @@
Suggested - Songs + Songs Albums Artists Genres diff --git a/dashboard-ui/musicartists.html b/dashboard-ui/musicartists.html index 62c6b8d122..701e49b902 100644 --- a/dashboard-ui/musicartists.html +++ b/dashboard-ui/musicartists.html @@ -10,7 +10,7 @@
Suggested - Songs + Songs Albums Artists Genres diff --git a/dashboard-ui/musicgenres.html b/dashboard-ui/musicgenres.html index 123e300398..ea0660b479 100644 --- a/dashboard-ui/musicgenres.html +++ b/dashboard-ui/musicgenres.html @@ -10,7 +10,7 @@
Suggested - Songs + Songs Albums Artists Genres diff --git a/dashboard-ui/musicrecommended.html b/dashboard-ui/musicrecommended.html index 6fdbe62976..88f09160b8 100644 --- a/dashboard-ui/musicrecommended.html +++ b/dashboard-ui/musicrecommended.html @@ -10,7 +10,7 @@
Suggested - Songs + Songs Albums Artists Genres diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index 4e441078a5..a9c9e79280 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -127,10 +127,18 @@ function setInitialCollapsibleState(page, item) { - if (item.ChildCount) { + if (item.ChildCount && item.Type == "MusicAlbum") { + $('#itemSongs', page).show(); + $('#childrenCollapsible', page).hide(); + renderChildren(page, item); + } + else if (item.ChildCount) { + $('#itemSongs', page).hide(); $('#childrenCollapsible', page).show(); renderChildren(page, item); - } else { + } + else { + $('#itemSongs', page).hide(); $('#childrenCollapsible', page).hide(); } if (LibraryBrowser.shouldDisplayGallery(item)) { @@ -212,7 +220,7 @@ if (item.Type == "MusicAlbum") { - $('#childrenContent', page).html(LibraryBrowser.getSongTableHtml(result.Items)).trigger('create'); + $('#itemSongs', page).html(LibraryBrowser.getSongTableHtml(result.Items)).trigger('create'); } else { var html = LibraryBrowser.getPosterDetailViewHtml({ diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index c583d00ee1..a81b064c91 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -162,19 +162,36 @@ return html; }, - getSongTableHtml: function (items) { + getSongTableHtml: function (items, options) { + + options = options || {}; var html = ''; - html += ''; + var cssClass = options.center ? "centeredDetailTable detailTable" : "detailTable"; + + if (options.strech) { + cssClass += " stretchedDetailTable"; + } + + html += '
'; html += ''; html += ''; + html += ''; + + if (options.showAlbum) { + html += ''; + } + if (options.showArtist) { + html += ''; + } + html += ''; html += ''; - html += ''; + html += ''; html += ''; @@ -193,13 +210,21 @@ html += ''; + if (options.showAlbum) { + html += ''; + } + + if (options.showArtist) { + html += ''; + } + var time = DashboardPage.getDisplayText(item.RunTimeTicks || 0); html += ''; html += ''; - html += ''; + html += ''; html += ''; } @@ -540,8 +565,15 @@ else if (item.Type == "Person") links.push('TV.com'); } - if (providerIds.Musicbrainz) - links.push('MusicBrainz'); + if (providerIds.Musicbrainz) { + + if (item.Type == "MusicArtist" || item.Type == "Artist") { + links.push('MusicBrainz'); + } else { + links.push('MusicBrainz'); + } + + } if (providerIds.Gamesdb) links.push('GamesDB'); @@ -996,12 +1028,10 @@ else if (item.MediaType == "Audio" || item.Type == "MusicAlbum") { url = "css/images/items/detail/audio.png"; useBackgroundColor = true; - maxwidth = 150; } else if (item.MediaType == "Game") { url = "css/images/items/detail/game.png"; useBackgroundColor = true; - maxwidth = 150; } else if (item.Type == "Person") { url = "css/images/items/detail/person.png"; diff --git a/dashboard-ui/scripts/songs.js b/dashboard-ui/scripts/songs.js new file mode 100644 index 0000000000..2118f5a58f --- /dev/null +++ b/dashboard-ui/scripts/songs.js @@ -0,0 +1,108 @@ +(function ($, document) { + + // The base query options + var query = { + + SortBy: "Artist,Album,SortName", + SortOrder: "Ascending", + IncludeItemTypes: "Audio", + Recursive: true, + Fields: "PrimaryImageAspectRatio,ItemCounts,DateCreated,UserData,AudioInfo,ParentId", + Limit: 200, + StartIndex: 0 + }; + + function reloadItems(page) { + + Dashboard.showLoadingMsg(); + + ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) { + + var html = ''; + + $('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create'); + + html += LibraryBrowser.getSongTableHtml(result.Items, { + showAlbum: true, + showArtist: true, + center: true, + strech: true + }); + + html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); + + $('#items', page).html(html).trigger('create'); + + $('.selectPage', page).on('change', function () { + query.StartIndex = (parseInt(this.value) - 1) * query.Limit; + reloadItems(page); + }); + + $('.btnNextPage', page).on('click', function () { + query.StartIndex += query.Limit; + reloadItems(page); + }); + + $('.btnPreviousPage', page).on('click', function () { + query.StartIndex -= query.Limit; + reloadItems(page); + }); + + Dashboard.hideLoadingMsg(); + }); + } + + $(document).on('pageinit', "#songsPage", function () { + + var page = this; + + $('.radioSortBy', this).on('click', function () { + query.SortBy = this.getAttribute('data-sortby'); + query.StartIndex = 0; + reloadItems(page); + }); + + $('.radioSortOrder', this).on('click', function () { + query.SortOrder = this.getAttribute('data-sortorder'); + query.StartIndex = 0; + reloadItems(page); + }); + + $('.chkStandardFilter', this).on('change', function () { + + var filterName = this.getAttribute('data-filter'); + var filters = query.Filters || ""; + + filters = (',' + filters).replace(',' + filterName, '').substring(1); + + if (this.checked) { + filters = filters ? (filters + ',' + filterName) : filterName; + } + + query.StartIndex = 0; + query.Filters = filters; + + reloadItems(page); + }); + + }).on('pagebeforeshow', "#songsPage", function () { + + reloadItems(this); + + }).on('pageshow', "#songsPage", function () { + + // Reset form values using the last used query + $('.radioSortBy', this).each(function () { + + this.checked = query.SortBy == this.getAttribute('data-sortby'); + + }).checkboxradio('refresh'); + + $('.radioSortOrder', this).each(function () { + + this.checked = query.SortOrder == this.getAttribute('data-sortorder'); + + }).checkboxradio('refresh'); + }); + +})(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/songs.html b/dashboard-ui/songs.html new file mode 100644 index 0000000000..a0ca210ffb --- /dev/null +++ b/dashboard-ui/songs.html @@ -0,0 +1,72 @@ + + + + Media Browser + + +
+

+ Music

+
+ +
+
+ + +
+
+
+
+
+
+
+ +
+
+ + Sort By: + + + + +
+ +
+ + Sort Order: + + + + + + + +
+ +
+
+
+
+ + Filters: + + + + + + + + + +
+ +
+
+ +
TrackAlbumArtistsDurationPlay Count
' + (item.Name || "") + '' + item.Album + '' + item.Artist + '' + time + '' + (item.UserData ? item.UserData.PlayCount : 0) + '' + LibraryBrowser.getUserDataIconsHtml(item) + '' + LibraryBrowser.getUserDataIconsHtml(item) + '