aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/TV
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-05-07 13:47:41 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-05-07 13:47:41 -0400
commit6adc668bed55948b89ee6adcc379cce7253da82c (patch)
treefbe7ed9c440f4ef4cc1e4c373232b00dfbe20380 /MediaBrowser.Controller/Entities/TV
parentd04b39421e54952241f9a3460a87413923cceb3a (diff)
update icons
Diffstat (limited to 'MediaBrowser.Controller/Entities/TV')
-rw-r--r--MediaBrowser.Controller/Entities/TV/Series.cs16
1 files changed, 4 insertions, 12 deletions
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs
index abca6a6431..a70bac6db4 100644
--- a/MediaBrowser.Controller/Entities/TV/Series.cs
+++ b/MediaBrowser.Controller/Entities/TV/Series.cs
@@ -9,6 +9,7 @@ using System.Linq;
using System.Runtime.Serialization;
using System.Threading;
using System.Threading.Tasks;
+using MoreLinq;
namespace MediaBrowser.Controller.Entities.TV
{
@@ -180,7 +181,7 @@ namespace MediaBrowser.Controller.Entities.TV
else
{
items = query.Recursive
- ? GetRecursiveChildren(user, filter)
+ ? GetSeasons(user).Cast<BaseItem>().Concat(GetEpisodes(user)).Where(filter)
: GetSeasons(user).Where(filter);
}
@@ -211,7 +212,7 @@ namespace MediaBrowser.Controller.Entities.TV
}
else
{
- seasons = base.GetChildren(user, true).OfType<Season>();
+ seasons = LibraryManager.Sort(base.GetChildren(user, true), user, new[] { ItemSortBy.SortName }, SortOrder.Ascending).OfType<Season>();
}
if (!includeMissingSeasons && !includeVirtualUnaired)
@@ -250,17 +251,8 @@ namespace MediaBrowser.Controller.Entities.TV
// Specials could appear twice based on above - once in season 0, once in the aired season
// This depends on settings for that series
// When this happens, remove the duplicate from season 0
- var returnList = new List<Episode>();
- foreach (var episode in allEpisodes)
- {
- if (!returnList.Contains(episode))
- {
- returnList.Insert(0, episode);
- }
- }
-
- return returnList;
+ return allEpisodes.DistinctBy(i => i.Id).Reverse();
}
public async Task RefreshAllMetadata(MetadataRefreshOptions refreshOptions, IProgress<double> progress, CancellationToken cancellationToken)