diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 656393585..40003e638 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -224,6 +224,7 @@ namespace MediaBrowser.Model.Configuration /// /// true if [enable tv db updates]; otherwise, false. public bool EnableTvDbUpdates { get; set; } + public bool EnableTmdbUpdates { get; set; } public bool EnableVideoImageExtraction { get; set; } diff --git a/MediaBrowser.Mono.userprefs b/MediaBrowser.Mono.userprefs index b773d7aef..a4e4b1751 100644 --- a/MediaBrowser.Mono.userprefs +++ b/MediaBrowser.Mono.userprefs @@ -1,25 +1,24 @@  - - - - - - - - - - - - + + + + + + + + - + + - + + + @@ -35,6 +34,7 @@ + diff --git a/MediaBrowser.Providers/Movies/PersonUpdatesPreScanTask.cs b/MediaBrowser.Providers/Movies/PersonUpdatesPreScanTask.cs index 347e4de97..e9d0b5c9a 100644 --- a/MediaBrowser.Providers/Movies/PersonUpdatesPreScanTask.cs +++ b/MediaBrowser.Providers/Movies/PersonUpdatesPreScanTask.cs @@ -60,7 +60,7 @@ namespace MediaBrowser.Providers.Movies /// Task. public async Task Run(IProgress progress, CancellationToken cancellationToken) { - if (!_config.Configuration.EnableInternetProviders) + if (!_config.Configuration.EnableInternetProviders || !_config.Configuration.EnableTmdbUpdates) { progress.Report(100); return; @@ -101,8 +101,8 @@ namespace MediaBrowser.Providers.Movies var updatedIds = await GetIdsToUpdate(lastUpdateDate, 1, cancellationToken).ConfigureAwait(false); - var existingDictionary = existingDirectories.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); - + var existingDictionary = existingDirectories.ToDictionary(i => i, StringComparer.OrdinalIgnoreCase); + var idsToUpdate = updatedIds.Where(i => !string.IsNullOrWhiteSpace(i) && existingDictionary.ContainsKey(i)); await UpdatePeople(idsToUpdate, path, progress, cancellationToken).ConfigureAwait(false); @@ -174,14 +174,9 @@ namespace MediaBrowser.Providers.Movies { await UpdatePerson(id, peopleDataPath, cancellationToken).ConfigureAwait(false); } - catch (HttpException ex) + catch (Exception ex) { - // Already logged at lower levels, but don't fail the whole operation, unless timed out - // We have to fail this to make it run again otherwise new episode data could potentially be missing - if (ex.IsTimedOut) - { - throw; - } + _logger.ErrorException("Error updating tmdb person id {0}", ex, id); } numComplete++; diff --git a/MediaBrowser.Providers/Movies/TmdbPersonProvider.cs b/MediaBrowser.Providers/Movies/TmdbPersonProvider.cs index f0c8e3dca..33fb27280 100644 --- a/MediaBrowser.Providers/Movies/TmdbPersonProvider.cs +++ b/MediaBrowser.Providers/Movies/TmdbPersonProvider.cs @@ -155,7 +155,7 @@ namespace MediaBrowser.Providers.Movies if (!string.IsNullOrEmpty(id)) { - await FetchInfo(person, id, cancellationToken).ConfigureAwait(false); + await FetchInfo(person, id, force, cancellationToken).ConfigureAwait(false); } else { @@ -219,9 +219,10 @@ namespace MediaBrowser.Providers.Movies /// /// The person. /// The id. + /// if set to true [is forced refresh]. /// The cancellation token. /// Task. - private async Task FetchInfo(Person person, string id, CancellationToken cancellationToken) + private async Task FetchInfo(Person person, string id, bool isForcedRefresh, CancellationToken cancellationToken) { var personDataPath = GetPersonDataPath(ConfigurationManager.ApplicationPaths, id); @@ -240,7 +241,7 @@ namespace MediaBrowser.Providers.Movies await DownloadPersonInfo(id, personDataPath, cancellationToken).ConfigureAwait(false); } - //if (!HasAltMeta(person)) + if (isForcedRefresh || ConfigurationManager.Configuration.EnableTmdbUpdates || !HasAltMeta(person)) { var info = JsonSerializer.DeserializeFromFile(Path.Combine(personDataPath, dataFileName));