aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Controller/Entities/TV/Episode.cs16
-rw-r--r--MediaBrowser.Controller/Entities/TV/Series.cs10
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs9
3 files changed, 17 insertions, 18 deletions
diff --git a/MediaBrowser.Controller/Entities/TV/Episode.cs b/MediaBrowser.Controller/Entities/TV/Episode.cs
index 5eab1cae0..40b999b02 100644
--- a/MediaBrowser.Controller/Entities/TV/Episode.cs
+++ b/MediaBrowser.Controller/Entities/TV/Episode.cs
@@ -86,7 +86,7 @@ namespace MediaBrowser.Controller.Entities.TV
{
get
{
- return Season;
+ return FindParent<Season>();
}
}
@@ -179,20 +179,6 @@ namespace MediaBrowser.Controller.Entities.TV
}
/// <summary>
- /// The _season
- /// </summary>
- private Season _season;
- /// <summary>
- /// This Episode's Season Instance
- /// </summary>
- /// <value>The season.</value>
- [IgnoreDataMember]
- public Season Season
- {
- get { return _season ?? (_season = FindParent<Season>()); }
- }
-
- /// <summary>
/// This is the ending episode number for double episodes.
/// </summary>
/// <value>The index number.</value>
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs
index f3c7b088a..b4a3fc811 100644
--- a/MediaBrowser.Controller/Entities/TV/Series.cs
+++ b/MediaBrowser.Controller/Entities/TV/Series.cs
@@ -4,6 +4,7 @@ using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.IO;
+using System.Linq;
using System.Runtime.Serialization;
namespace MediaBrowser.Controller.Entities.TV
@@ -100,5 +101,14 @@ namespace MediaBrowser.Controller.Entities.TV
return args;
}
+
+ [IgnoreDataMember]
+ public bool ContainsEpisodesWithoutSeasonFolders
+ {
+ get
+ {
+ return Children.OfType<Video>().Any();
+ }
+ }
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs
index 0a6a72fc1..693594a20 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs
@@ -20,7 +20,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
var season = args.Parent as Season;
// If the parent is a Season or Series, then this is an Episode if the VideoResolver returns something
- if (season != null)
+ if (season != null || args.Parent is Series)
{
Episode episode = null;
@@ -51,8 +51,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
if (episode != null)
{
- episode.ParentIndexNumber = season.IndexNumber;
-
+ if (season != null)
+ {
+ episode.ParentIndexNumber = season.IndexNumber;
+ }
+
if (episode.ParentIndexNumber == null)
{
episode.ParentIndexNumber = TVUtils.GetSeasonNumberFromEpisodeFile(args.Path);