diff --git a/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs b/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs
index b34a692d3e..be105b63af 100644
--- a/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs
+++ b/MediaBrowser.Providers/Movies/FanArtMovieProvider.cs
@@ -148,22 +148,13 @@ namespace MediaBrowser.Providers.Movies
return false;
}
- // Refresh if tmdb id has changed
- if (providerInfo.Data != GetComparisonData(item.GetProviderId(MetadataProviders.Tmdb)))
- {
- return true;
- }
-
return base.NeedsRefreshInternal(item, providerInfo);
}
- ///
- /// Gets the comparison data.
- ///
- /// The id.
- /// Guid.
- private Guid GetComparisonData(string id)
+ protected override DateTime CompareDate(BaseItem item)
{
+ var id = item.GetProviderId(MetadataProviders.Tmdb);
+
if (!string.IsNullOrEmpty(id))
{
// Process images
@@ -171,16 +162,16 @@ namespace MediaBrowser.Providers.Movies
var files = new DirectoryInfo(path)
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
- .Select(i => i.FullName + i.LastWriteTimeUtc.Ticks)
+ .Select(i => i.LastWriteTimeUtc)
.ToArray();
if (files.Length > 0)
{
- return string.Join(string.Empty, files).GetMD5();
+ return files.Max();
}
}
- return Guid.Empty;
+ return base.CompareDate(item);
}
///
@@ -253,7 +244,6 @@ namespace MediaBrowser.Providers.Movies
await FetchFromXml(item, xmlPath, cancellationToken).ConfigureAwait(false);
}
- data.Data = GetComparisonData(item.GetProviderId(MetadataProviders.Tmdb));
SetLastRefreshed(item, DateTime.UtcNow);
return true;
}
diff --git a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs
index b92d4ad0ed..1685846d6f 100644
--- a/MediaBrowser.Providers/Music/FanArtArtistProvider.cs
+++ b/MediaBrowser.Providers/Music/FanArtArtistProvider.cs
@@ -132,20 +132,10 @@ namespace MediaBrowser.Providers.Music
return false;
}
- if (GetComparisonData(item) != providerInfo.Data)
- {
- return true;
- }
-
return base.NeedsRefreshInternal(item, providerInfo);
}
- ///
- /// Gets the comparison data.
- ///
- /// The item.
- /// Guid.
- private Guid GetComparisonData(BaseItem item)
+ protected override DateTime CompareDate(BaseItem item)
{
var musicBrainzId = item.GetProviderId(MetadataProviders.Musicbrainz);
@@ -156,16 +146,16 @@ namespace MediaBrowser.Providers.Music
var files = new DirectoryInfo(path)
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
- .Select(i => i.FullName + i.LastWriteTimeUtc.Ticks)
+ .Select(i => i.LastWriteTimeUtc)
.ToArray();
if (files.Length > 0)
{
- return string.Join(string.Empty, files).GetMD5();
+ return files.Max();
}
}
- return Guid.Empty;
+ return base.CompareDate(item);
}
///
@@ -249,8 +239,6 @@ namespace MediaBrowser.Providers.Music
item.ProviderData[Id] = data;
}
- data.Data = GetComparisonData(item);
-
SetLastRefreshed(item, DateTime.UtcNow);
return true;
}
diff --git a/MediaBrowser.Providers/TV/FanArtTVProvider.cs b/MediaBrowser.Providers/TV/FanArtTVProvider.cs
index ea0a1c1289..878cd26e2a 100644
--- a/MediaBrowser.Providers/TV/FanArtTVProvider.cs
+++ b/MediaBrowser.Providers/TV/FanArtTVProvider.cs
@@ -1,5 +1,4 @@
using MediaBrowser.Common.Configuration;
-using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
@@ -79,21 +78,14 @@ namespace MediaBrowser.Providers.TV
{
return false;
}
-
- if (providerInfo.Data != GetComparisonData(item.GetProviderId(MetadataProviders.Tvdb)))
- {
- return true;
- }
return base.NeedsRefreshInternal(item, providerInfo);
}
- ///
- /// Gets the comparison data.
- ///
- /// Guid.
- private Guid GetComparisonData(string id)
+ protected override DateTime CompareDate(BaseItem item)
{
+ var id = item.GetProviderId(MetadataProviders.Tvdb);
+
if (!string.IsNullOrEmpty(id))
{
// Process images
@@ -101,16 +93,16 @@ namespace MediaBrowser.Providers.TV
var files = new DirectoryInfo(path)
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
- .Select(i => i.FullName + i.LastWriteTimeUtc.Ticks)
+ .Select(i => i.LastWriteTimeUtc)
.ToArray();
if (files.Length > 0)
{
- return string.Join(string.Empty, files).GetMD5();
+ return files.Max();
}
}
- return Guid.Empty;
+ return base.CompareDate(item);
}
///
@@ -202,7 +194,6 @@ namespace MediaBrowser.Providers.TV
await FetchFromXml(item, xmlPath, cancellationToken).ConfigureAwait(false);
}
- data.Data = GetComparisonData(item.GetProviderId(MetadataProviders.Tvdb));
SetLastRefreshed(item, DateTime.UtcNow);
return true;
diff --git a/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs b/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs
index ae11da68fa..6bf0a00d93 100644
--- a/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs
+++ b/MediaBrowser.Providers/TV/RemoteSeriesProvider.cs
@@ -162,29 +162,7 @@ namespace MediaBrowser.Providers.TV
}
}
- ///
- /// Needses the refresh internal.
- ///
- /// The item.
- /// The provider info.
- /// true if XXXX, false otherwise
- protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
- {
- // Refresh even if local metadata exists because we need episode infos
- if (GetComparisonData(item) != providerInfo.Data)
- {
- return true;
- }
-
- return base.NeedsRefreshInternal(item, providerInfo);
- }
-
- ///
- /// Gets the comparison data.
- ///
- /// The item.
- /// Guid.
- private Guid GetComparisonData(BaseItem item)
+ protected override DateTime CompareDate(BaseItem item)
{
var seriesId = item.GetProviderId(MetadataProviders.Tvdb);
@@ -195,16 +173,16 @@ namespace MediaBrowser.Providers.TV
var files = new DirectoryInfo(path)
.EnumerateFiles("*.xml", SearchOption.TopDirectoryOnly)
- .Select(i => i.FullName + i.LastWriteTimeUtc.Ticks)
+ .Select(i => i.LastWriteTimeUtc)
.ToArray();
if (files.Length > 0)
{
- return string.Join(string.Empty, files).GetMD5();
+ return files.Max();
}
}
- return Guid.Empty;
+ return base.CompareDate(item);
}
///
@@ -245,8 +223,6 @@ namespace MediaBrowser.Providers.TV
item.ProviderData[Id] = data;
}
- data.Data = GetComparisonData(item);
-
SetLastRefreshed(item, DateTime.UtcNow);
return true;
}