From a3a333d1682dfa8a890426544e9701cf3b236cd2 Mon Sep 17 00:00:00 2001 From: softworkz Date: Wed, 23 Mar 2016 01:36:35 +0100 Subject: [PATCH] TheTVDB Episode Provider: Fixed incorrect fallback to absolute episode numbering --- .../TV/TheTVDB/TvdbEpisodeProvider.cs | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs index 392033048..291214fcd 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs @@ -259,36 +259,36 @@ namespace MediaBrowser.Providers.TV return files; } - if (seasonNumber == null) - { - return files; - } - - var file = Path.Combine(seriesDataPath, string.Format("episode-{0}-{1}.xml", seasonNumber.Value, episodeNumber)); - - var fileInfo = _fileSystem.GetFileInfo(file); var usingAbsoluteData = false; - if (fileInfo.Exists) - { - files.Add(fileInfo); - } - else - { - file = Path.Combine(seriesDataPath, string.Format("episode-abs-{0}.xml", episodeNumber)); - fileInfo = _fileSystem.GetFileInfo(file); - if (fileInfo.Exists) - { - files.Add(fileInfo); - usingAbsoluteData = true; - } - } + if (seasonNumber.HasValue) + { + var file = Path.Combine(seriesDataPath, string.Format("episode-{0}-{1}.xml", seasonNumber.Value, episodeNumber)); + var fileInfo = _fileSystem.GetFileInfo(file); + + if (fileInfo.Exists) + { + files.Add(fileInfo); + } + } + else + { + usingAbsoluteData = true; + var file = Path.Combine(seriesDataPath, string.Format("episode-abs-{0}.xml", episodeNumber)); + var fileInfo = _fileSystem.GetFileInfo(file); + if (fileInfo.Exists) + { + files.Add(fileInfo); + } + } var end = endingEpisodeNumber ?? episodeNumber; episodeNumber++; while (episodeNumber <= end) { + string file; + if (usingAbsoluteData) { file = Path.Combine(seriesDataPath, string.Format("episode-abs-{0}.xml", episodeNumber)); @@ -298,7 +298,7 @@ namespace MediaBrowser.Providers.TV file = Path.Combine(seriesDataPath, string.Format("episode-{0}-{1}.xml", seasonNumber.Value, episodeNumber)); } - fileInfo = _fileSystem.GetFileInfo(file); + var fileInfo = _fileSystem.GetFileInfo(file); if (fileInfo.Exists) { files.Add(fileInfo);