diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index f05bcd64a5..0333057367 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -52,7 +52,7 @@ html += ""; } - else if (item.MediaType == "Video") { + else if (item.MediaType == "Video" || item.Type == "Season" || item.Type == "Series") { html += ""; } diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js index 0e637014ab..26d716f47c 100644 --- a/dashboard-ui/scripts/tvshows.js +++ b/dashboard-ui/scripts/tvshows.js @@ -1,159 +1,184 @@ (function ($, document) { - // The base query options - var query = { + // The base query options + var query = { - SortBy: "SortName", - SortOrder: "Ascending", - IncludeItemTypes: "Series", - Recursive: true, - Fields: "PrimaryImageAspectRatio,SeriesInfo" - }; + SortBy: "SortName", + SortOrder: "Ascending", + IncludeItemTypes: "Series", + Recursive: true, + Fields: "PrimaryImageAspectRatio,SeriesInfo" + }; - function getTableHtml(items) { + function getTableHtml(items) { - var html = '
'; + var html = '
'; - html += ''; + html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; - html += ''; + html += ''; - html += ''; + html += ''; - for (var i = 0, length = items.length; i < length; i++) { + for (var i = 0, length = items.length; i < length; i++) { - html += getRowHtml(items[i]); - } + html += getRowHtml(items[i]); + } - html += ''; + html += ''; - html += '
 NameYearOfficial RatingRuntimeCommunity Rating
 NameYearOfficial RatingRuntimeCommunity Rating
'; + html += ''; - return html; - } + return html; + } - function getRowHtml(item) { + function getRowHtml(item) { - var html = ''; + var html = ''; - html += ''; + html += ''; - var url = "itemdetails.html?id=" + item.Id; + var url = "itemdetails.html?id=" + item.Id; - var imageTags = item.ImageTags; + var imageTags = item.ImageTags; - html += ''; + html += ''; - if (imageTags.Primary) { + if (imageTags.Primary) { - html += ''; + html += ''; - } - else { - html += ''; - } + } + else { + html += ''; + } - html += ''; + html += ''; - html += '' + item.Name + ''; + html += '' + item.Name + ''; - html += '' + (item.ProductionYear || "") + ''; + html += '' + (item.ProductionYear || "") + ''; - html += '' + (item.OfficialRating || "") + ''; - html += '' + (item.RunTimeTicks || "") + ''; - html += '' + (item.CommunityRating || "") + ''; + html += '' + (item.OfficialRating || "") + ''; + html += '' + (item.RunTimeTicks || "") + ''; + html += '' + (item.CommunityRating || "") + ''; - html += ''; - return html; - } + html += ''; + return html; + } - function reloadItems(page) { + function reloadItems(page) { - Dashboard.showLoadingMsg(); + Dashboard.showLoadingMsg(); - ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) { + ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) { - $('#items', page).html(LibraryBrowser.getPosterViewHtml({ + $('#items', page).html(LibraryBrowser.getPosterViewHtml({ - items: result.Items, - useAverageAspectRatio: true + items: result.Items, + useAverageAspectRatio: true - }))/*.html(getTableHtml(result.Items)).trigger('create')*/; + }))/*.html(getTableHtml(result.Items)).trigger('create')*/; - Dashboard.hideLoadingMsg(); - }); - } + Dashboard.hideLoadingMsg(); + }); + } - $(document).on('pageinit', "#tvShowsPage", function () { + $(document).on('pageinit', "#tvShowsPage", function () { - var page = this; + var page = this; - $('.radioSortBy', this).on('click', function () { - query.SortBy = this.getAttribute('data-sortby'); - reloadItems(page); - }); + $('.radioSortBy', this).on('click', function () { + query.SortBy = this.getAttribute('data-sortby'); + reloadItems(page); + }); - $('.radioSortOrder', this).on('click', function () { - query.SortOrder = this.getAttribute('data-sortorder'); - reloadItems(page); - }); + $('.radioSortOrder', this).on('click', function () { + query.SortOrder = this.getAttribute('data-sortorder'); + reloadItems(page); + }); - $('.chkStandardFilter', this).on('change', function () { + $('.chkStandardFilter', this).on('change', function () { - var filterName = this.getAttribute('data-filter'); - var filters = query.Filters || ""; + var filterName = this.getAttribute('data-filter'); + var filters = query.Filters || ""; - filters = (',' + filters).replace(',' + filterName, '').substring(1); + filters = (',' + filters).replace(',' + filterName, '').substring(1); - if (this.checked) { - filters = filters ? (filters + ',' + filterName) : filterName; - } + if (this.checked) { + filters = filters ? (filters + ',' + filterName) : filterName; + } - query.Filters = filters; + query.Filters = filters; - reloadItems(page); - }); + reloadItems(page); + }); - }).on('pagebeforeshow', "#tvShowsPage", function () { + $('.chkStatus', this).on('change', function () { - reloadItems(this); + var filterName = this.getAttribute('data-filter'); + var filters = query.SeriesStatus || ""; - }).on('pageshow', "#tvShowsPage", function () { + filters = (',' + filters).replace(',' + filterName, '').substring(1); - // Reset form values using the last used query - $('.radioSortBy', this).each(function () { + if (this.checked) { + filters = filters ? (filters + ',' + filterName) : filterName; + } - this.checked = query.SortBy == this.getAttribute('data-sortby'); + query.SeriesStatus = filters; - }).checkboxradio('refresh'); + reloadItems(page); + }); - $('.radioSortOrder', this).each(function () { + }).on('pagebeforeshow', "#tvShowsPage", function () { - this.checked = query.SortOrder == this.getAttribute('data-sortorder'); + reloadItems(this); - }).checkboxradio('refresh'); + }).on('pageshow', "#tvShowsPage", function () { - $('.chkStandardFilter', this).each(function () { + // Reset form values using the last used query + $('.radioSortBy', this).each(function () { - var filters = "," + (query.Filters || ""); - var filterName = this.getAttribute('data-filter'); + this.checked = query.SortBy == this.getAttribute('data-sortby'); - this.checked = filters.indexOf(',' + filterName) != -1; + }).checkboxradio('refresh'); - }).checkboxradio('refresh'); - }); + $('.chkStatus', this).each(function () { + + var filters = "," + (query.SeriesStatus || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }).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/tvshows.html b/dashboard-ui/tvshows.html index 0e790a5664..518c38d57f 100644 --- a/dashboard-ui/tvshows.html +++ b/dashboard-ui/tvshows.html @@ -74,6 +74,16 @@ + +
+ +

Status:

+
+ + + + +