From 7fe1a3311dc32fd618c4d9156286153c2335dec1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 15 Nov 2013 16:31:33 -0500 Subject: [PATCH] Display specials within seasons --- dashboard-ui/css/librarybrowser.css | 2 +- dashboard-ui/css/search.css | 11 +++++++++-- dashboard-ui/scripts/Itemdetailpage.js | 12 +++++++++++- dashboard-ui/scripts/librarybrowser.js | 14 ++++++++++---- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 360566cfa..3b3527e4d 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -129,7 +129,7 @@ .libraryViewNav a { display: inline-block; - padding: .25em .25em; + padding: .5em .25em; color: #eee!important; text-decoration: none; } diff --git a/dashboard-ui/css/search.css b/dashboard-ui/css/search.css index 7864decc8..634221ded 100644 --- a/dashboard-ui/css/search.css +++ b/dashboard-ui/css/search.css @@ -8,7 +8,7 @@ vertical-align: middle; font: 13px arial,sans-serif; margin: 0 .15em 0 0; - width: 150px; + width: 80px; padding: 0; border: 1px solid #4d90fe; } @@ -108,13 +108,20 @@ padding: 2px 5px; } -@media all and (min-width: 340px) { +@media all and (min-width: 300px) { .headerSearch { display: inline-block; } } +@media all and (min-width: 340px) { + + .txtSearch { + width: 150px; + } +} + @media all and (min-width: 850px) { .txtSearch { diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index 82cc66a20..eb6f02654 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -505,6 +505,15 @@ Fields: "ItemCounts,DateCreated,AudioInfo" }; + if (item.Type == "Season" && item.IndexNumber) { + + query.ParentId = item.SeriesId; + query.Recursive = true; + query.IncludeItemTypes = "Episode"; + query.AiredDuringSeason = item.IndexNumber; + query.SortBy = "PremiereDate,SortName"; + } + if (item.Type == "Series" || item.Type == "Season") { if (!user.Configuration.DisplayMissingEpisodes) { query.IsMissing = false; @@ -532,7 +541,8 @@ items: result.Items, useAverageAspectRatio: true, shape: shape, - showParentName: false + showParentName: false, + displayAsSpecial: item.Type == "Season" && item.IndexNumber }); $('#childrenContent', page).html(html); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index badb867e4..e3288fe54 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -201,7 +201,7 @@ } } - var name = LibraryBrowser.getPosterViewDisplayName(item); + var name = LibraryBrowser.getPosterViewDisplayName(item, options.displayAsSpecial); html += '
' + name + '
'; @@ -972,11 +972,16 @@ return day; }, - getPosterViewDisplayName: function (item) { + getPosterViewDisplayName: function (item, displayAsSpecial) { var name = item.Name; - if (item.Type == "Episode" && item.IndexNumber != null && item.ParentIndexNumber != null) { + if (displayAsSpecial && item.Type == "Episode" && item.SpecialSeasonNumber) { + + name = "Special - " + name; + + } + else if (item.Type == "Episode" && item.IndexNumber != null && item.ParentIndexNumber != null) { var displayIndexNumber = item.IndexNumber < 10 ? "0" + item.IndexNumber : item.IndexNumber; @@ -990,7 +995,8 @@ name = number + " - " + name; - } else { + } + else { if (item.IndexNumber != null && item.Type !== "Season") { name = item.IndexNumber + " - " + name; }