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 @@
+'; + html += ' | Track | '; + + if (options.showAlbum) { + html += 'Album | '; + } + if (options.showArtist) { + html += 'Artists | '; + } + html += 'Duration | '; html += 'Play Count | '; - html += ''; + html += ' | '; html += ' | ' + (item.Name || "") + ' | '; + if (options.showAlbum) { + html += '' + item.Album + ' | '; + } + + if (options.showArtist) { + html += '' + item.Artist + ' | '; + } + var time = DashboardPage.getDisplayText(item.RunTimeTicks || 0); html += '' + time + ' | '; html += '' + (item.UserData ? item.UserData.PlayCount : 0) + ' | '; - html += '' + LibraryBrowser.getUserDataIconsHtml(item) + ' | '; + html += '' + LibraryBrowser.getUserDataIconsHtml(item) + ' | '; 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 @@ + + + +
---|