diff options
Diffstat (limited to 'MediaBrowser.Providers/TV/TvdbPrescanTask.cs')
| -rw-r--r-- | MediaBrowser.Providers/TV/TvdbPrescanTask.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/MediaBrowser.Providers/TV/TvdbPrescanTask.cs b/MediaBrowser.Providers/TV/TvdbPrescanTask.cs index 94f857d9c..d77698725 100644 --- a/MediaBrowser.Providers/TV/TvdbPrescanTask.cs +++ b/MediaBrowser.Providers/TV/TvdbPrescanTask.cs @@ -1,11 +1,13 @@ -using System.Globalization; +using MediaBrowser.Common.IO; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Net; using System; using System.Collections.Generic; +using System.Globalization; using System.IO; using System.Linq; using System.Text; @@ -42,6 +44,7 @@ namespace MediaBrowser.Providers.TV /// The _config /// </summary> private readonly IServerConfigurationManager _config; + private readonly IFileSystem _fileSystem; /// <summary> /// Initializes a new instance of the <see cref="TvdbPrescanTask"/> class. @@ -49,11 +52,12 @@ namespace MediaBrowser.Providers.TV /// <param name="logger">The logger.</param> /// <param name="httpClient">The HTTP client.</param> /// <param name="config">The config.</param> - public TvdbPrescanTask(ILogger logger, IHttpClient httpClient, IServerConfigurationManager config) + public TvdbPrescanTask(ILogger logger, IHttpClient httpClient, IServerConfigurationManager config, IFileSystem fileSystem) { _logger = logger; _httpClient = httpClient; _config = config; + _fileSystem = fileSystem; } protected readonly CultureInfo UsCulture = new CultureInfo("en-US"); @@ -66,7 +70,8 @@ namespace MediaBrowser.Providers.TV /// <returns>Task.</returns> public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) { - if (!_config.Configuration.EnableInternetProviders) + if (!_config.Configuration.EnableInternetProviders || + _config.Configuration.InternetProviderExcludeTypes.Contains(typeof(Series).Name, StringComparer.OrdinalIgnoreCase)) { progress.Report(100); return; @@ -81,7 +86,7 @@ namespace MediaBrowser.Providers.TV var timestampFileInfo = new FileInfo(timestampFile); // Don't check for tvdb updates anymore frequently than 24 hours - if (timestampFileInfo.Exists && (DateTime.UtcNow - timestampFileInfo.LastWriteTimeUtc).TotalDays < 1) + if (timestampFileInfo.Exists && (DateTime.UtcNow - _fileSystem.GetLastWriteTimeUtc(timestampFileInfo)).TotalDays < 1) { return; } |
