diff --git a/dashboard-ui/libraryreport.html b/dashboard-ui/libraryreport.html index 4c4761fe82..7895a593e6 100644 --- a/dashboard-ui/libraryreport.html +++ b/dashboard-ui/libraryreport.html @@ -18,6 +18,23 @@
+
+ +
@@ -28,12 +45,14 @@ - Parent + Parent Name - Type - Date/Year + Date Added + Release Date Rating Runtime + Codecs + Subtitles Features @@ -57,43 +76,6 @@
-
- - Type: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Video Type: diff --git a/dashboard-ui/scripts/editorsidebar.js b/dashboard-ui/scripts/editorsidebar.js index 6ba515efde..1ab0593c93 100644 --- a/dashboard-ui/scripts/editorsidebar.js +++ b/dashboard-ui/scripts/editorsidebar.js @@ -67,7 +67,7 @@ return { attr: { id: item.Id, rel: rel, itemtype: item.Type }, data: htmlName, state: state }; } - function loadChildrenOfRootNode(callback, openItems) { + function loadChildrenOfRootNode(page, callback, openItems, selectedId) { var promise1 = $.getJSON(ApiClient.getUrl("Library/MediaFolders")); @@ -110,6 +110,14 @@ callback(nodes); + if (selectedId && nodes.filter(function (f) { + + return f.attr.id == selectedId; + + }).length) { + + selectNode(page, selectedId); + } }); } @@ -135,7 +143,7 @@ if (node == '-1') { - loadChildrenOfRootNode(callback, openItems); + loadChildrenOfRootNode(page, callback, openItems, selectedId); return; } diff --git a/dashboard-ui/scripts/libraryreport.js b/dashboard-ui/scripts/libraryreport.js index b960e604ab..6cf6751d9d 100644 --- a/dashboard-ui/scripts/libraryreport.js +++ b/dashboard-ui/scripts/libraryreport.js @@ -6,28 +6,24 @@ SortBy: "SeriesSortName,SortName", SortOrder: "Ascending", Recursive: true, - Fields: "", - StartIndex: 0 + Fields: "MediaStreams,DateCreated", + StartIndex: 0, + IncludeItemTypes: "Movie" }; + + function getCodecName(stream) { - function getFriendlyTypeName(type) { + var val = stream.Codec || ''; + val = val.toUpperCase(); + + if (val == 'DCA') { + return stream.Profile; + } - if (type == "MusicArtist") { - return "Artist"; - } - if (type == "MusicAlbum") { - return "Album"; - } - if (type == "Audio") { - return "Song"; - } - if (type == "BoxSet") { - return "Collection"; - } - return type; + return val; } - function getTableRowsHtml(items) { + function getTableRowsHtml(items, includeParentInfo, includeSubtitles) { var html = ''; @@ -44,27 +40,36 @@ } html += ''; - html += ''; - if (item.SeriesName) { - html += '' + item.SeriesName + ''; + if (includeParentInfo) { + html += ''; + if (item.SeriesName) { + html += '' + item.SeriesName + ''; + } + else if (item.Album) { + html += item.Album + '
'; + } + else if (item.AlbumArtist) { + html += item.AlbumArtist + '
'; + } + else { + html += ' '; + } + html += ''; } - else if (item.Album) { - html += item.Album + '
'; - } - else if (item.AlbumArtist) { - html += item.AlbumArtist + '
'; - } - else { - html += ' '; - } - html += ''; html += ''; html += '' + LibraryBrowser.getPosterViewDisplayName(item, false, true) + ''; html += ''; html += ''; - html += getFriendlyTypeName(item.Type); + if (item.DateCreated) { + try { + html += parseISO8601Date(item.DateCreated, { toLocal: true }).toLocaleDateString(); + } + catch (e) { + html += ' '; + } + } html += ''; html += ''; @@ -118,6 +123,32 @@ } html += ''; + html += ''; + html += (item.MediaStreams || []).filter(function(s) { + + return s.Type != 'Subtitle'; + + }).map(getCodecName).filter(function (s) { + return s; + }).join('
'); + + html += ''; + + if (includeSubtitles) { + html += ''; + html += (item.MediaStreams || []).filter(function (s) { + + return s.Type == 'Subtitle'; + + }).map(function (s) { + + return (s.Language || 'Und') + ' - ' + s.Codec; + + }).join('
'); + + html += ''; + } + html += ''; if (item.SpecialFeatureCount == 1) { @@ -154,7 +185,36 @@ $('.listBottomPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount)).trigger('create'); - $('.resultBody', page).html(getTableRowsHtml(result.Items)).parents('.tblLibraryReport').table("refresh").trigger('create'); + var includeParentInfo = query.IncludeItemTypes == "Audio" || query.IncludeItemTypes == "MusicAlbum" || query.IncludeItemTypes == "Episode" || query.IncludeItemTypes == "Book"; + var includeSubtitles = query.IncludeItemTypes == "Movie" || query.IncludeItemTypes == "Trailer" || query.IncludeItemTypes == "Episode" || query.IncludeItemTypes == "AdultVideo" || query.IncludeItemTypes == "MusicVideo" || query.IncludeItemTypes == "Video"; + + if (includeParentInfo) { + + var parentLabel = "Series"; + + if (query.IncludeItemTypes == "Audio") { + parentLabel = "Album"; + } + else if (query.IncludeItemTypes == "MusicAlbum") { + parentLabel = "Artist"; + } + + $('.thParent', page).html(parentLabel).show(); + + } else { + $('.thParent', page).hide(); + } + + if (includeSubtitles) { + + $('.thSubtitles', page).show(); + + } else { + $('.thSubtitles', page).hide(); + } + + var rowsHtml = getTableRowsHtml(result.Items, includeParentInfo, includeSubtitles); + $('.resultBody', page).html(rowsHtml).parents('.tblLibraryReport').table("refresh").trigger('create'); $('.btnNextPage', page).on('click', function () { query.StartIndex += query.Limit; @@ -186,14 +246,7 @@ function updateFilterControls(page) { - $('.chkTypeFilter', page).each(function () { - - var filters = "," + (query.IncludeItemTypes || ""); - var filterName = this.getAttribute('data-filter'); - - this.checked = filters.indexOf(',' + filterName) != -1; - - }).checkboxradio('refresh'); + $('#selectView').val(query.IncludeItemTypes).selectmenu('refresh'); $('.chkVideoTypeFilter', page).each(function () { @@ -255,19 +308,10 @@ } }); - $('.chkTypeFilter', page).on('change', function () { - - var filterName = this.getAttribute('data-filter'); - var filters = query.IncludeItemTypes || ""; - - filters = (',' + filters).replace(',' + filterName, '').substring(1); - - if (this.checked) { - filters = filters ? (filters + ',' + filterName) : filterName; - } + $('#selectView', page).on('change', function () { query.StartIndex = 0; - query.IncludeItemTypes = filters; + query.IncludeItemTypes = this.value; reloadItems(page); });