diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index 52ccec97dc..4f2d27f800 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -502,7 +502,7 @@ var query = { ParentId: item.Id, SortBy: sortBy, - Fields: "PrimaryImageAspectRatio,ItemCounts,DateCreated,AudioInfo" + Fields: "ItemCounts,DateCreated,AudioInfo" }; if (item.Type == "Series" || item.Type == "Season") { diff --git a/dashboard-ui/scripts/edititemmetadata.js b/dashboard-ui/scripts/edititemmetadata.js index 09d9975112..1658ac3fcc 100644 --- a/dashboard-ui/scripts/edititemmetadata.js +++ b/dashboard-ui/scripts/edititemmetadata.js @@ -63,7 +63,7 @@ return { attr: { id: item.Id, rel: rel, itemtype: item.Type }, data: htmlName, state: state }; } - function loadNode(page, node, openItems, selectedId, callback) { + function loadNode(page, node, openItems, selectedId, currentUser, callback) { if (node == '-1') { @@ -76,13 +76,20 @@ return; } - ApiClient.getItems(Dashboard.getCurrentUserId(), { - + var query = { ParentId: node.attr("id"), SortBy: 'SortName', Fields: 'MetadataSettings' + }; + + if (!currentUser.Configuration.DisplayMissingEpisodes) { + query.IsMissing = false; + } + if (!currentUser.Configuration.DisplayUnairedEpisodes) { + query.IsVirtualUnaired = false; + } - }).done(function (result) { + ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) { var nodes = result.Items.map(function (i) { @@ -120,20 +127,20 @@ $(document).scrollTop(0); } - function initializeTree(page, openItems, selectedId) { + function initializeTree(page, currentUser, openItems, selectedId) { $('.libraryTree', page).jstree({ "plugins": ["themes", "ui", "json_data"], data: function (node, callback) { - loadNode(page, node, openItems, selectedId, callback); + loadNode(page, node, openItems, selectedId, currentUser, callback); }, json_data: { data: function (node, callback) { - loadNode(page, node, openItems, selectedId, callback); + loadNode(page, node, openItems, selectedId, currentUser, callback); } }, @@ -164,22 +171,26 @@ var page = this; - var id = MetadataEditor.currentItemId; + Dashboard.getCurrentUser().done(function(user) { + + var id = MetadataEditor.currentItemId; - if (id) { + if (id) { - ApiClient.getAncestorItems(id, Dashboard.getCurrentUserId()).done(function (ancestors) { + ApiClient.getAncestorItems(id, user.Id).done(function (ancestors) { - var ids = ancestors.map(function (i) { - return i.Id; + var ids = ancestors.map(function (i) { + return i.Id; + }); + + initializeTree(page, user, ids, id); }); - initializeTree(page, ids, id); - }); + } else { + initializeTree(page, user, []); + } - } else { - initializeTree(page, []); - } + }); }).on('pagebeforehide', ".metadataEditorPage", function () { diff --git a/dashboard-ui/scripts/episodes.js b/dashboard-ui/scripts/episodes.js index ec181eacb3..e5d551670b 100644 --- a/dashboard-ui/scripts/episodes.js +++ b/dashboard-ui/scripts/episodes.js @@ -10,7 +10,9 @@ IncludeItemTypes: "Episode", Recursive: true, Fields: "DateCreated,SeriesInfo", - StartIndex: 0 + StartIndex: 0, + IsMissing: false, + IsVirtualUnaired: false }; function reloadItems(page) { @@ -49,7 +51,7 @@ query.StartIndex = 0; query.SortOrder = 'Ascending'; query.SortBy = $('.defaultSort', page).data('sortby'); - + reloadItems(page); }); @@ -83,7 +85,7 @@ } function updateFilterControls(page) { - + // Reset form values using the last used query $('.radioSortBy', page).each(function () { @@ -224,15 +226,23 @@ $('#chkMissingEpisode', this).on('change', function () { query.StartIndex = 0; - query.IsMissing = this.checked ? true : null; - + query.IsMissing = this.checked ? true : false; + reloadItems(page); }); $('#chkFutureEpisode', this).on('change', function () { query.StartIndex = 0; - query.IsUnaired = this.checked ? true : null; + + if (this.checked) { + query.IsUnaired = true; + query.IsVirtualUnaired = null; + } else { + query.IsUnaired = null; + query.IsVirtualUnaired = false; + } + reloadItems(page); }); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index e7e7c37258..30629610ff 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -66,8 +66,6 @@ options.shape = options.preferBackdrop ? "backdrop" : "poster"; } - var primaryImageAspectRatio = options.useAverageAspectRatio ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null; - var html = ''; for (var i = 0, length = items.length; i < length; i++) { @@ -87,7 +85,6 @@ var imgUrl = null; var isDefault = false; var height = null; - var width = null; var cssClass = "tileItem"; @@ -117,23 +114,19 @@ else if (item.ImageTags && item.ImageTags.Primary) { height = 300; - width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null; imgUrl = LibraryBrowser.getImageUrl(item, 'Primary', 0, { - height: height, - width: width + maxheight: height }); } else if (item.AlbumId && item.AlbumPrimaryImageTag) { height = 300; - width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null; imgUrl = ApiClient.getImageUrl(item.AlbumId, { type: "Primary", height: 100, - width: width, tag: item.AlbumPrimaryImageTag }); diff --git a/dashboard-ui/scripts/tvupcoming.js b/dashboard-ui/scripts/tvupcoming.js index 300de944a6..02f10c3ce4 100644 --- a/dashboard-ui/scripts/tvupcoming.js +++ b/dashboard-ui/scripts/tvupcoming.js @@ -11,7 +11,7 @@ IncludeItemTypes: "Episode", Limit: 30, Recursive: true, - Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData", + Fields: "SeriesInfo,UserData", IsUnaired: true }; @@ -23,7 +23,6 @@ } $('#upcomingItems', page).html(LibraryBrowser.getPosterViewHtml({ items: result.Items, - useAverageAspectRatio: true, showLocationTypeIndicator: false, showNewIndicator: false, shape: "backdrop",