fixed xml providers running over and over

This commit is contained in:
Luke Pulverenti
2013-10-01 14:24:27 -04:00
parent 900266eb54
commit 3d40c5ba36
42 changed files with 323 additions and 395 deletions

View File

@@ -30,10 +30,7 @@ namespace MediaBrowser.Controller.Entities
{
var path = Configuration.UseCustomLibrary ? GetRootFolderPath(Name) : ConfigurationManager.ApplicationPaths.DefaultUserViewsPath;
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
Directory.CreateDirectory(path);
return path;
}
@@ -256,10 +253,7 @@ namespace MediaBrowser.Controller.Entities
{
_configurationDirectoryPath = GetConfigurationDirectoryPath(Name);
if (!Directory.Exists(_configurationDirectoryPath))
{
Directory.CreateDirectory(_configurationDirectoryPath);
}
Directory.CreateDirectory(_configurationDirectoryPath);
}
return _configurationDirectoryPath;

View File

@@ -205,10 +205,7 @@ namespace MediaBrowser.Controller.IO
}
// Check if the target directory exists, if not, create it.
if (!Directory.Exists(target))
{
Directory.CreateDirectory(target);
}
Directory.CreateDirectory(target);
foreach (var file in Directory.EnumerateFiles(source))
{

View File

@@ -159,10 +159,7 @@ namespace MediaBrowser.Controller.MediaInfo
{
var parentPath = Path.GetDirectoryName(path);
if (!Directory.Exists(parentPath))
{
Directory.CreateDirectory(parentPath);
}
Directory.CreateDirectory(parentPath);
await _encoder.ExtractImage(inputPath, type, video.Video3DFormat, time, path, cancellationToken).ConfigureAwait(false);
chapter.ImagePath = path;

View File

@@ -233,16 +233,6 @@ namespace MediaBrowser.Controller.Providers
throw new ArgumentNullException("providerInfo");
}
if (CompareDate(item) > providerInfo.LastRefreshed)
{
return true;
}
if (RefreshOnFileSystemStampChange && item.LocationType == LocationType.FileSystem && HasFileSystemStampChanged(item, providerInfo))
{
return true;
}
if (RefreshOnVersionChange && !String.Equals(ProviderVersion, providerInfo.ProviderVersion))
{
return true;
@@ -258,9 +248,30 @@ namespace MediaBrowser.Controller.Providers
return true;
}
if (NeedsRefreshBasedOnCompareDate(item, providerInfo))
{
return true;
}
if (RefreshOnFileSystemStampChange && item.LocationType == LocationType.FileSystem && HasFileSystemStampChanged(item, providerInfo))
{
return true;
}
return false;
}
/// <summary>
/// Needses the refresh based on compare date.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="providerInfo">The provider info.</param>
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
protected virtual bool NeedsRefreshBasedOnCompareDate(BaseItem item, BaseProviderInfo providerInfo)
{
return CompareDate(item) > providerInfo.LastRefreshed;
}
/// <summary>
/// Determines if the item's file system stamp has changed from the last time the provider refreshed
/// </summary>