mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 02:22:31 +01:00
Don't skip files/folders that are too fresh on import
This commit is contained in:
parent
455196eefb
commit
ef62af75df
@ -63,16 +63,6 @@ public void should_import_file()
|
|||||||
VerifyImport();
|
VerifyImport();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void should_skip_if_folder_is_too_fresh()
|
|
||||||
{
|
|
||||||
WithRecentFolderWrite();
|
|
||||||
|
|
||||||
Subject.ProcessDownloadedEpisodesFolder();
|
|
||||||
|
|
||||||
VerifyNoImport();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void should_search_for_series_using_folder_name()
|
public void should_search_for_series_using_folder_name()
|
||||||
{
|
{
|
||||||
|
@ -94,13 +94,6 @@ public void ProcessDownloadedEpisodesFolder()
|
|||||||
|
|
||||||
public void ProcessSubFolder(DirectoryInfo subfolderInfo)
|
public void ProcessSubFolder(DirectoryInfo subfolderInfo)
|
||||||
{
|
{
|
||||||
var lastFolderWrite = _diskProvider.GetLastFolderWrite(subfolderInfo.FullName);
|
|
||||||
if (lastFolderWrite.AddMinutes(2) > DateTime.UtcNow)
|
|
||||||
{
|
|
||||||
_logger.Trace("[{0}] is too fresh. skipping. Last write {1} UTC", subfolderInfo.FullName, lastFolderWrite);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var series = _parsingService.GetSeries(subfolderInfo.Name);
|
var series = _parsingService.GetSeries(subfolderInfo.Name);
|
||||||
|
|
||||||
if (series == null)
|
if (series == null)
|
||||||
@ -119,14 +112,6 @@ public void ProcessSubFolder(DirectoryInfo subfolderInfo)
|
|||||||
|
|
||||||
private void ProcessVideoFile(string videoFile, Series series)
|
private void ProcessVideoFile(string videoFile, Series series)
|
||||||
{
|
{
|
||||||
var lastWrite = _diskProvider.GetLastFileWrite(videoFile);
|
|
||||||
|
|
||||||
if (lastWrite.AddMinutes(2) > DateTime.UtcNow)
|
|
||||||
{
|
|
||||||
_logger.Trace("[{0}] is too fresh. skipping. Last Write {1} UTC", videoFile, lastWrite);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_diskProvider.IsFileLocked(new FileInfo(videoFile)))
|
if (_diskProvider.IsFileLocked(new FileInfo(videoFile)))
|
||||||
{
|
{
|
||||||
_logger.Trace("[{0}] is currently locked by another process, skipping", videoFile);
|
_logger.Trace("[{0}] is currently locked by another process, skipping", videoFile);
|
||||||
|
Loading…
Reference in New Issue
Block a user