diff options
Diffstat (limited to 'MediaBrowser.Providers/TV/EpisodeXmlParser.cs')
| -rw-r--r-- | MediaBrowser.Providers/TV/EpisodeXmlParser.cs | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/MediaBrowser.Providers/TV/EpisodeXmlParser.cs b/MediaBrowser.Providers/TV/EpisodeXmlParser.cs index 5188e0824b..5d970107e4 100644 --- a/MediaBrowser.Providers/TV/EpisodeXmlParser.cs +++ b/MediaBrowser.Providers/TV/EpisodeXmlParser.cs @@ -2,6 +2,7 @@ using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Logging; +using System.Globalization; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -38,6 +39,8 @@ namespace MediaBrowser.Providers.TV } } + private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); + /// <summary> /// Fetches the data from XML node. /// </summary> @@ -139,19 +142,57 @@ namespace MediaBrowser.Providers.TV break; } - case "SpecialSeasonNumber": + case "airsbefore_episode": { - var number = reader.ReadElementContentAsString(); + var val = reader.ReadElementContentAsString(); - if (!string.IsNullOrWhiteSpace(number)) + if (!string.IsNullOrWhiteSpace(val)) { - int num; + int rval; - if (int.TryParse(number, out num)) + // int.TryParse is local aware, so it can be probamatic, force us culture + if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval)) { - item.SpecialSeasonNumber = num; + item.AirsBeforeEpisodeNumber = rval; } } + + break; + } + + case "airsafter_season": + { + var val = reader.ReadElementContentAsString(); + + if (!string.IsNullOrWhiteSpace(val)) + { + int rval; + + // int.TryParse is local aware, so it can be probamatic, force us culture + if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval)) + { + item.AirsAfterSeasonNumber = rval; + } + } + + break; + } + + case "airsbefore_season": + { + var val = reader.ReadElementContentAsString(); + + if (!string.IsNullOrWhiteSpace(val)) + { + int rval; + + // int.TryParse is local aware, so it can be probamatic, force us culture + if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval)) + { + item.AirsBeforeSeasonNumber = rval; + } + } + break; } |
