Directory write time is now calculated based on the most recent file write to any file inside of that directory.

This commit is contained in:
kay.one 2012-01-22 20:59:23 -08:00
commit ead5f37921
4 changed files with 60 additions and 7 deletions

View file

@ -31,7 +31,15 @@ namespace NzbDrone.Common
throw new DirectoryNotFoundException("Directory doesn't exist. " + path);
}
GetFiles(path, SearchOption.AllDirectories);
var dirFiles = GetFiles(path, SearchOption.AllDirectories).ToList();
if (!dirFiles.Any())
{
return new DirectoryInfo(path).LastWriteTimeUtc;
}
return dirFiles.Select(f => new FileInfo(f))
.Max(c => c.LastWriteTimeUtc);
}
public virtual bool FolderExists(string path)