diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-24 11:01:53 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-05-24 11:01:53 -0400 |
| commit | 1141fcc3741e8c2195365f623854ff6ada7e6f99 (patch) | |
| tree | 20e5a069a55a8aae577d38833840ae7a514ae80e /MediaBrowser.Server.Implementations/Library/Resolvers | |
| parent | 6be50fefc1a9fac3b573e50feaa18dd1939f3fc6 (diff) | |
fixes #289 - Rename "Season 0" to "Specials"?
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/Resolvers')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs index 07fb2f4864..7ad5d08db6 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeasonResolver.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Entities.TV; +using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using System; @@ -10,6 +11,20 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV public class SeasonResolver : FolderResolver<Season> { /// <summary> + /// The _config + /// </summary> + private readonly IServerConfigurationManager _config; + + /// <summary> + /// Initializes a new instance of the <see cref="SeasonResolver"/> class. + /// </summary> + /// <param name="config">The config.</param> + public SeasonResolver(IServerConfigurationManager config) + { + _config = config; + } + + /// <summary> /// Resolves the specified args. /// </summary> /// <param name="args">The args.</param> @@ -18,10 +33,17 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV { if (args.Parent is Series && args.IsDirectory) { - return new Season + var season = new Season { IndexNumber = TVUtils.GetSeasonNumberFromPath(args.Path) }; + + if (season.IndexNumber.HasValue && season.IndexNumber.Value == 0) + { + season.Name = _config.Configuration.SeasonZeroDisplayName; + } + + return season; } return null; |
