mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
Organized tests for DiskScan and PostDownload
Added tests for GetVideoFiles and ProcessVideoFile
This commit is contained in:
parent
3cdd479bb4
commit
cc6011ec87
16 changed files with 921 additions and 433 deletions
|
@ -42,6 +42,14 @@ namespace NzbDrone.Common
|
|||
.Max(c => c.LastWriteTimeUtc);
|
||||
}
|
||||
|
||||
public virtual DateTime GetLastFileWrite(string path)
|
||||
{
|
||||
if (!FileExists(path))
|
||||
throw new FileNotFoundException("File doesn't exist: " + path);
|
||||
|
||||
return new FileInfo(path).LastWriteTimeUtc;
|
||||
}
|
||||
|
||||
public virtual bool FolderExists(string path)
|
||||
{
|
||||
return Directory.Exists(path);
|
||||
|
@ -209,5 +217,13 @@ namespace NzbDrone.Common
|
|||
{
|
||||
return String.Equals(firstPath.NormalizePath(), secondPath.NormalizePath(), StringComparison.InvariantCultureIgnoreCase);
|
||||
}
|
||||
|
||||
public virtual long GetFileSize(string path)
|
||||
{
|
||||
if (!FileExists(path))
|
||||
throw new FileNotFoundException("File doesn't exist: " + path);
|
||||
|
||||
return new FileInfo(path).Length;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue