mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
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:
parent
a68c882032
commit
ead5f37921
4 changed files with 60 additions and 7 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue