From 1141fcc3741e8c2195365f623854ff6ada7e6f99 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 24 May 2013 11:01:53 -0400 Subject: fixes #289 - Rename "Season 0" to "Specials"? --- .../Library/Resolvers/TV/SeasonResolver.cs | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library/Resolvers') 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; @@ -9,6 +10,20 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV /// public class SeasonResolver : FolderResolver { + /// + /// The _config + /// + private readonly IServerConfigurationManager _config; + + /// + /// Initializes a new instance of the class. + /// + /// The config. + public SeasonResolver(IServerConfigurationManager config) + { + _config = config; + } + /// /// Resolves the specified args. /// @@ -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; -- cgit v1.2.3