fixed checking against wrong provider id

pull/702/head
Luke Pulverenti 12 years ago
parent 9d24362695
commit b79c1c7b08

@ -120,12 +120,6 @@ namespace MediaBrowser.Controller.Providers.Movies
return false; return false;
} }
// Refresh if tmdb id has changed
if (providerInfo.Data != GetComparisonData(item.GetProviderId(MetadataProviders.Tmdb)))
{
return true;
}
if (!ConfigurationManager.Configuration.DownloadMovieImages.Art && if (!ConfigurationManager.Configuration.DownloadMovieImages.Art &&
!ConfigurationManager.Configuration.DownloadMovieImages.Logo && !ConfigurationManager.Configuration.DownloadMovieImages.Logo &&
!ConfigurationManager.Configuration.DownloadMovieImages.Disc && !ConfigurationManager.Configuration.DownloadMovieImages.Disc &&
@ -136,6 +130,12 @@ namespace MediaBrowser.Controller.Providers.Movies
return false; return false;
} }
// Refresh if tmdb id has changed
if (providerInfo.Data != GetComparisonData(item.GetProviderId(MetadataProviders.Tmdb)))
{
return true;
}
return base.NeedsRefreshInternal(item, providerInfo); return base.NeedsRefreshInternal(item, providerInfo);
} }

@ -203,7 +203,7 @@ namespace MediaBrowser.Controller.Providers.TV
} }
} }
data.Data = GetComparisonData(item.GetProviderId(MetadataProviders.Tvcom)); data.Data = GetComparisonData(item.GetProviderId(MetadataProviders.Tvdb));
SetLastRefreshed(series, DateTime.UtcNow, status); SetLastRefreshed(series, DateTime.UtcNow, status);
return true; return true;

@ -121,8 +121,8 @@ namespace MediaBrowser.Controller.Providers.TV
if (seriesId != null) if (seriesId != null)
{ {
await FetchEpisodeData(episode, seriesId, cancellationToken).ConfigureAwait(false); var status = await FetchEpisodeData(episode, seriesId, cancellationToken).ConfigureAwait(false);
SetLastRefreshed(item, DateTime.UtcNow); SetLastRefreshed(item, DateTime.UtcNow, status);
return true; return true;
} }
Logger.Info("Episode provider cannot determine Series Id for " + item.Path); Logger.Info("Episode provider cannot determine Series Id for " + item.Path);
@ -140,18 +140,18 @@ namespace MediaBrowser.Controller.Providers.TV
/// <param name="seriesId">The series id.</param> /// <param name="seriesId">The series id.</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{System.Boolean}.</returns> /// <returns>Task{System.Boolean}.</returns>
private async Task<bool> FetchEpisodeData(Episode episode, string seriesId, CancellationToken cancellationToken) private async Task<ProviderRefreshStatus> FetchEpisodeData(Episode episode, string seriesId, CancellationToken cancellationToken)
{ {
string name = episode.Name;
string location = episode.Path; string location = episode.Path;
string epNum = TVUtils.EpisodeNumberFromFile(location, episode.Season != null); string epNum = TVUtils.EpisodeNumberFromFile(location, episode.Season != null);
var status = ProviderRefreshStatus.Success;
if (epNum == null) if (epNum == null)
{ {
Logger.Warn("TvDbProvider: Could not determine episode number for: " + episode.Path); Logger.Warn("TvDbProvider: Could not determine episode number for: " + episode.Path);
return false; return status;
} }
var episodeNumber = Int32.Parse(epNum); var episodeNumber = Int32.Parse(epNum);
@ -159,7 +159,7 @@ namespace MediaBrowser.Controller.Providers.TV
episode.IndexNumber = episodeNumber; episode.IndexNumber = episodeNumber;
var usingAbsoluteData = false; var usingAbsoluteData = false;
if (string.IsNullOrEmpty(seriesId)) return false; if (string.IsNullOrEmpty(seriesId)) return status;
var seasonNumber = ""; var seasonNumber = "";
if (episode.Parent is Season) if (episode.Parent is Season)
@ -240,10 +240,7 @@ namespace MediaBrowser.Controller.Providers.TV
} }
catch (HttpException) catch (HttpException)
{ {
} status = ProviderRefreshStatus.CompletedWithErrors;
catch (IOException)
{
} }
} }
@ -303,12 +300,12 @@ namespace MediaBrowser.Controller.Providers.TV
await _providerManager.SaveToLibraryFilesystem(episode, Path.Combine(episode.MetaLocation, Path.GetFileNameWithoutExtension(episode.Path) + ".xml"), ms, cancellationToken).ConfigureAwait(false); await _providerManager.SaveToLibraryFilesystem(episode, Path.Combine(episode.MetaLocation, Path.GetFileNameWithoutExtension(episode.Path) + ".xml"), ms, cancellationToken).ConfigureAwait(false);
} }
return true; return status;
} }
} }
return false; return status;
} }
/// <summary> /// <summary>

@ -55,7 +55,8 @@ namespace MediaBrowser.Controller.Providers.TV
/// <value>The priority.</value> /// <value>The priority.</value>
public override MetadataProviderPriority Priority public override MetadataProviderPriority Priority
{ {
get { return MetadataProviderPriority.Second; } // Run after fanart
get { return MetadataProviderPriority.Fourth; }
} }
/// <summary> /// <summary>

Loading…
Cancel
Save