diff --git a/ApiClient.js b/ApiClient.js index f56d3744be..be4267d3c6 100644 --- a/ApiClient.js +++ b/ApiClient.js @@ -1552,6 +1552,29 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; + /** + Gets people from an item + */ + self.getPeople = function (userId, options) { + + if (!userId) { + throw new Error("null userId"); + } + + var parentId = options.parentId || "root"; + + // Don't put these on the query string + delete options.parentId; + + var url = self.getUrl("Users/" + userId + "/Items/" + parentId + "/Persons", options); + + return self.ajax({ + type: "GET", + url: url, + dataType: "json" + }); + }; + /** Gets studios from an item */ diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 411a549b4e..ec52ca422b 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -251,6 +251,11 @@ .posterDetailViewImage { max-height: 140px; + max-width: 50%; + } + + .posterDetailViewContentContainer { + width: 47%; } .posterDetailViewItem .userDataIcons { diff --git a/dashboard-ui/moviegenres.html b/dashboard-ui/moviegenres.html index 01b34ba577..fd7254f30f 100644 --- a/dashboard-ui/moviegenres.html +++ b/dashboard-ui/moviegenres.html @@ -17,9 +17,54 @@ Studios
+ +
+
+ +
+
+ + Sort By: + + + + +
+ +
+ + Sort Order: + + + + + + + +
+
+
+
+
+
+ + Filters: + + + + + + + + + +
+
+
+ diff --git a/dashboard-ui/moviepeople.html b/dashboard-ui/moviepeople.html index a264bbc5e0..bd43d93dde 100644 --- a/dashboard-ui/moviepeople.html +++ b/dashboard-ui/moviepeople.html @@ -17,9 +17,54 @@ Studios
+ +
+
+ +
+
+ + Sort By: + + + + +
+ +
+ + Sort Order: + + + + + + + +
+
+
+
+
+
+ + Filters: + + + + + + + + + +
+
+
+ diff --git a/dashboard-ui/moviestudios.html b/dashboard-ui/moviestudios.html index bf0c442833..095160db4f 100644 --- a/dashboard-ui/moviestudios.html +++ b/dashboard-ui/moviestudios.html @@ -17,9 +17,53 @@ Studios
+ +
+
+ +
+
+ + Sort By: + + + + +
+ +
+ + Sort Order: + + + + + + + +
+
+
+
+
+
+ + Filters: + + + + + + + + + +
+
+
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 2186041406..c8ada67c50 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -51,11 +51,9 @@ var height = 300; var width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null; - html += ""; @@ -77,6 +75,10 @@ html += ""; } + else if (item.Type == "Person") { + + html += ""; + } else { html += ""; @@ -163,6 +165,29 @@ return item.IsFolder ? (item.Id ? "itemList.html?parentId=" + item.Id : "#") : "itemdetails.html?id=" + item.Id; }, + + getPrimaryImageUrl: function (item, options) { + + options = options || {}; + options.type = "Primary"; + options.tag = item.ImageTags.Primary; + + if (item.Type == "Studio") { + + return ApiClient.getStudioImageUrl(item.Name, options); + } + if (item.Type == "Person") { + + return ApiClient.getPersonImageUrl(item.Name, options); + } + if (item.Type == "Genre") { + + return ApiClient.getGenreImageUrl(item.Name, options); + } + + return ApiClient.getImageUrl(item.Id, options); + + }, getPosterViewHtml: function (options) { diff --git a/dashboard-ui/scripts/moviegenres.js b/dashboard-ui/scripts/moviegenres.js index b3e6d6b558..55fae5bfb8 100644 --- a/dashboard-ui/scripts/moviegenres.js +++ b/dashboard-ui/scripts/moviegenres.js @@ -48,13 +48,56 @@ }); } - $(document).on('pagebeforeshow', "#movieGenresPage", function () { + $(document).on('pageinit', "#movieGenresPage", 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.Filters = filters; + + reloadItems(page); + }); + + }).on('pagebeforeshow', "#movieGenresPage", function () { reloadItems(this); }).on('pageshow', "#movieGenresPage", 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/scripts/moviepeople.js b/dashboard-ui/scripts/moviepeople.js index 5f282702bb..9af503a1e5 100644 --- a/dashboard-ui/scripts/moviepeople.js +++ b/dashboard-ui/scripts/moviepeople.js @@ -1 +1,103 @@ - \ No newline at end of file +(function ($, document) { + + // The base query options + var query = { + + SortBy: "SortName", + SortOrder: "Ascending", + IncludeItemTypes: "Movie", + Recursive: true, + Fields: "PrimaryImageAspectRatio,ItemCounts,DateCreated,UserData", + Limit: LibraryBrowser.getDetaultPageSize(), + StartIndex: 0 + }; + + function reloadItems(page) { + + Dashboard.showLoadingMsg(); + + ApiClient.getPeople(Dashboard.getCurrentUserId(), query).done(function (result) { + + var html = ''; + + var showPaging = result.TotalRecordCount > query.Limit; + + if (showPaging) { + html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true); + } + + html += LibraryBrowser.getPosterDetailViewHtml({ + items: result.Items, + useAverageAspectRatio: true, + countNameSingular: "Movie", + countNamePlural: "Movies" + }); + + if (showPaging) { + html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); + } + + var elem = $('#items', page).html(html).trigger('create'); + + $('select', elem).on('change', function () { + query.StartIndex = (parseInt(this.value) - 1) * query.Limit; + reloadItems(page); + }); + + Dashboard.hideLoadingMsg(); + }); + } + + $(document).on('pageinit', "#moviePeoplePage", 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.Filters = filters; + + reloadItems(page); + }); + + }).on('pagebeforeshow', "#moviePeoplePage", function () { + + reloadItems(this); + + }).on('pageshow', "#moviePeoplePage", 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/scripts/moviestudios.js b/dashboard-ui/scripts/moviestudios.js index 59a006c053..5b36e6e5fe 100644 --- a/dashboard-ui/scripts/moviestudios.js +++ b/dashboard-ui/scripts/moviestudios.js @@ -48,12 +48,56 @@ }); } - $(document).on('pagebeforeshow', "#movieStudiosPage", function () { + $(document).on('pageinit', "#movieStudiosPage", 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.Filters = filters; + + reloadItems(page); + }); + + }).on('pagebeforeshow', "#movieStudiosPage", function () { reloadItems(this); }).on('pageshow', "#movieStudiosPage", 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'); }); diff --git a/dashboard-ui/scripts/tvgenres.js b/dashboard-ui/scripts/tvgenres.js index 63df889a6d..38ebf3c525 100644 --- a/dashboard-ui/scripts/tvgenres.js +++ b/dashboard-ui/scripts/tvgenres.js @@ -48,13 +48,65 @@ }); } - $(document).on('pagebeforeshow', "#tvGenresPage", function () { + $(document).on('pageinit', "#tvGenresPage", 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.Filters = filters; + + reloadItems(page); + }); + + }).on('pagebeforeshow', "#tvGenresPage", function () { reloadItems(this); }).on('pageshow', "#tvGenresPage", 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'); + + $('.chkStandardFilter', this).each(function () { + + var filters = "," + (query.Filters || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }).checkboxradio('refresh'); }); })(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/tvpeople.js b/dashboard-ui/scripts/tvpeople.js new file mode 100644 index 0000000000..e70589569f --- /dev/null +++ b/dashboard-ui/scripts/tvpeople.js @@ -0,0 +1,112 @@ +(function ($, document) { + + // The base query options + var query = { + + SortBy: "SortName", + SortOrder: "Ascending", + IncludeItemTypes: "Series", + Recursive: true, + Fields: "PrimaryImageAspectRatio,ItemCounts,DateCreated,UserData", + Limit: LibraryBrowser.getDetaultPageSize(), + StartIndex: 0 + }; + + function reloadItems(page) { + + Dashboard.showLoadingMsg(); + + ApiClient.getPeople(Dashboard.getCurrentUserId(), query).done(function (result) { + + var html = ''; + + var showPaging = result.TotalRecordCount > query.Limit; + + if (showPaging) { + html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true); + } + + html += LibraryBrowser.getPosterDetailViewHtml({ + items: result.Items, + useAverageAspectRatio: true, + countNameSingular: "Show", + countNamePlural: "Shows" + }); + + if (showPaging) { + html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); + } + + var elem = $('#items', page).html(html).trigger('create'); + + $('select', elem).on('change', function () { + query.StartIndex = (parseInt(this.value) - 1) * query.Limit; + reloadItems(page); + }); + + Dashboard.hideLoadingMsg(); + }); + } + + $(document).on('pageinit', "#tvPeoplePage", 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.Filters = filters; + + reloadItems(page); + }); + + }).on('pagebeforeshow', "#tvPeoplePage", function () { + + reloadItems(this); + + }).on('pageshow', "#tvPeoplePage", 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'); + + $('.chkStandardFilter', this).each(function () { + + var filters = "," + (query.Filters || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }).checkboxradio('refresh'); + }); + +})(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/tvstudios.js b/dashboard-ui/scripts/tvstudios.js index 3cee6262b5..4fb145e680 100644 --- a/dashboard-ui/scripts/tvstudios.js +++ b/dashboard-ui/scripts/tvstudios.js @@ -48,13 +48,65 @@ }); } - $(document).on('pagebeforeshow', "#tvStudiosPage", function () { + $(document).on('pageinit', "#tvStudiosPage", 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.Filters = filters; + + reloadItems(page); + }); + + }).on('pagebeforeshow', "#tvStudiosPage", function () { reloadItems(this); }).on('pageshow', "#tvStudiosPage", 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'); + + $('.chkStandardFilter', this).each(function () { + + var filters = "," + (query.Filters || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }).checkboxradio('refresh'); }); })(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/tvgenres.html b/dashboard-ui/tvgenres.html index 08e36adab0..6e92c239b3 100644 --- a/dashboard-ui/tvgenres.html +++ b/dashboard-ui/tvgenres.html @@ -12,13 +12,58 @@ Suggested Shows Genres - Actors + Actors Networks
+ +
+
+ +
+
+ + Sort By: + + + + +
+ +
+ + Sort Order: + + + + + + + +
+
+
+
+
+
+ + Filters: + + + + + + + + + +
+
+
+ diff --git a/dashboard-ui/tvpeople.html b/dashboard-ui/tvpeople.html new file mode 100644 index 0000000000..bd0b57e6ec --- /dev/null +++ b/dashboard-ui/tvpeople.html @@ -0,0 +1,69 @@ + + + + Media Browser + + +
+

+ TV Shows

+
+ +
+ + +
+
+
+
+ +
+
+ + Sort By: + + + + +
+ +
+ + Sort Order: + + + + + + + +
+
+
+
+
+
+ + Filters: + + + + + + + + + +
+
+
+ +
+ + diff --git a/dashboard-ui/tvrecommended.html b/dashboard-ui/tvrecommended.html index 8b2a8ce8a6..fb5609b7b5 100644 --- a/dashboard-ui/tvrecommended.html +++ b/dashboard-ui/tvrecommended.html @@ -12,7 +12,7 @@ Suggested Shows Genres - Actors + Actors Networks
diff --git a/dashboard-ui/tvseries.html b/dashboard-ui/tvseries.html index 955ab1ffb5..a8e0f983ee 100644 --- a/dashboard-ui/tvseries.html +++ b/dashboard-ui/tvseries.html @@ -14,7 +14,7 @@ Suggested Shows Genres - Actors + Actors Networks
diff --git a/dashboard-ui/tvshows.html b/dashboard-ui/tvshows.html index 724fe998e4..0d6ab94bef 100644 --- a/dashboard-ui/tvshows.html +++ b/dashboard-ui/tvshows.html @@ -12,7 +12,7 @@ Suggested Shows Genres - Actors + Actors Networks
diff --git a/dashboard-ui/tvstudios.html b/dashboard-ui/tvstudios.html index b6eb18c4a0..861f4704c3 100644 --- a/dashboard-ui/tvstudios.html +++ b/dashboard-ui/tvstudios.html @@ -12,13 +12,58 @@ Suggested Shows Genres - Actors + Actors Networks
+ +
+
+ +
+
+ + Sort By: + + + + +
+ +
+ + Sort Order: + + + + + + + +
+
+
+
+
+
+ + Filters: + + + + + + + + + +
+
+
+ diff --git a/packages.config b/packages.config index b9bc666028..8669c3db34 100644 --- a/packages.config +++ b/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file