From 3eb34de6498810f5a819c5da273e7a2938840acb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 31 Mar 2013 13:39:28 -0400 Subject: [PATCH] fixes #97 and creates a library dictionary cache to avoid FindById recursion --- dashboard-ui/index.html | 10 ++------- dashboard-ui/itemdetails.html | 4 ++-- dashboard-ui/itemlist.html | 27 ++++++++++------------ dashboard-ui/scripts/Itemdetailpage.js | 4 ++-- dashboard-ui/scripts/indexpage.js | 31 -------------------------- dashboard-ui/scripts/itemlistpage.js | 15 ++++++++++--- 6 files changed, 30 insertions(+), 61 deletions(-) diff --git a/dashboard-ui/index.html b/dashboard-ui/index.html index 714d59ff35..6239a5471e 100644 --- a/dashboard-ui/index.html +++ b/dashboard-ui/index.html @@ -6,7 +6,7 @@
-

What's New +

What's New

@@ -18,13 +18,7 @@

-

My Library -

- -
- -

Collections -

+

Collections

diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index 8e32c04dc4..5d459d42f2 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -24,6 +24,8 @@
+

+

@@ -35,8 +37,6 @@

-

-

diff --git a/dashboard-ui/itemlist.html b/dashboard-ui/itemlist.html index 06471aa5e1..77a2f012a7 100644 --- a/dashboard-ui/itemlist.html +++ b/dashboard-ui/itemlist.html @@ -34,28 +34,28 @@

Sort By:

- - + + - + - - + + - + - + - + - + - + @@ -64,10 +64,10 @@

Sort Order:

- + - + @@ -92,9 +92,6 @@ - - - diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index 5c24dbf80d..27b88d258f 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -731,9 +731,9 @@ } if (userData.IsFavorite) { - html += 'Favorite'; + html += 'Favorite'; } else { - html += 'Favorite'; + html += 'Favorite'; } $('#itemRatings', page).html(html); diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index 8dff90f64f..f2c39ce046 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -70,37 +70,6 @@ })); }); - - IndexPage.loadMyLibrary(userId, page); - }, - - loadMyLibrary: function (userId, page) { - - var items = [{ - Name: "Recently Played", - IsFolder: true - }, { - Name: "Favorites", - IsFolder: true, - url: "itemlist.html?IsFavorite=true&Recursive=true&Title=Favorites" - }, { - Name: "Genres", - IsFolder: true - }, { - Name: "Studios", - IsFolder: true - }, { - Name: "Performers", - IsFolder: true - }, { - Name: "Directors", - IsFolder: true - }]; - - $('#divMyLibrary', page).html(Dashboard.getPosterViewHtml({ - items: items, - showTitle: true - })); } }; diff --git a/dashboard-ui/scripts/itemlistpage.js b/dashboard-ui/scripts/itemlistpage.js index 7be0b5eadb..4d6d4e2577 100644 --- a/dashboard-ui/scripts/itemlistpage.js +++ b/dashboard-ui/scripts/itemlistpage.js @@ -13,7 +13,6 @@ var query = { Fields: "PrimaryImageAspectRatio", - SortBy: "SortName", Recursive: getParameterByName('Recursive') == 'true' }; @@ -34,7 +33,19 @@ $('#chkRecentlyAdded', page).checked(true).checkboxradio("refresh"); } + var sortBy = getParameterByName('SortBy') || 'SortName'; + query.SortBy = sortBy; + $('.radioSortBy', page).checked(false).checkboxradio("refresh"); + $('#radio' + sortBy, page).checked(true).checkboxradio("refresh"); + + var order = getParameterByName('SortOrder') || 'Ascending'; + + query.SortOrder = order; + $('.radioSortOrder', page).checked(false).checkboxradio("refresh"); + $('#radio' + order, page).checked(true).checkboxradio("refresh"); + query.Filters = filters.join(','); + //query.limit = 100; if (parentId) { query.parentId = parentId; @@ -112,8 +123,6 @@ query.Filters = filters; - query.Recursive = filters.length ? true : false; - ItemListPage.refreshItems(query); },