mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 05:23:31 -07:00
cleaned up parsing logic and structure.
This commit is contained in:
parent
cd2761d07d
commit
6e88f55a54
120 changed files with 2149 additions and 3064 deletions
|
@ -24,7 +24,7 @@ namespace NzbDrone.Common
|
|||
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public virtual DateTime GetLastDirectoryWrite(string path)
|
||||
public virtual DateTime GetLastFolderWrite(string path)
|
||||
{
|
||||
if (!FolderExists(path))
|
||||
{
|
||||
|
@ -50,6 +50,15 @@ namespace NzbDrone.Common
|
|||
return new FileInfo(path).LastWriteTimeUtc;
|
||||
}
|
||||
|
||||
|
||||
public virtual void EnsureFolder(string path)
|
||||
{
|
||||
if (!FolderExists(path))
|
||||
{
|
||||
CreateFolder(path);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool FolderExists(string path)
|
||||
{
|
||||
return Directory.Exists(path);
|
||||
|
@ -84,7 +93,7 @@ namespace NzbDrone.Common
|
|||
return fi.Length;
|
||||
}
|
||||
|
||||
public virtual String CreateDirectory(string path)
|
||||
public virtual String CreateFolder(string path)
|
||||
{
|
||||
return Directory.CreateDirectory(path).FullName;
|
||||
}
|
||||
|
@ -191,7 +200,7 @@ namespace NzbDrone.Common
|
|||
File.SetAccessControl(filename, fs);
|
||||
}
|
||||
|
||||
public virtual ulong FreeDiskSpace(string path)
|
||||
public virtual ulong GetAvilableSpace(string path)
|
||||
{
|
||||
if (!FolderExists(path))
|
||||
throw new DirectoryNotFoundException(path);
|
||||
|
@ -237,7 +246,7 @@ namespace NzbDrone.Common
|
|||
{
|
||||
var files = GetFileInfos(path, "*.*", SearchOption.AllDirectories);
|
||||
|
||||
foreach(var fileInfo in files)
|
||||
foreach (var fileInfo in files)
|
||||
{
|
||||
if (IsFileLocked(fileInfo))
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue