Fix: Successful downloads that are not moved properly should be retried.

This commit is contained in:
Mark McDowall 2012-04-17 14:44:20 -07:00
commit c0d1d2c502
6 changed files with 170 additions and 1 deletions

View file

@ -253,6 +253,33 @@ namespace NzbDrone.Core.Providers
}
}
public virtual void CleanUpDropFolder(string path)
{
//Todo: We should rename files before importing them to prevent this issue from ever happening
var filesOnDisk = GetVideoFiles(path);
foreach(var file in filesOnDisk)
{
try
{
var episodeFile = _mediaFileProvider.GetFileByPath(file);
if (episodeFile != null)
{
Logger.Trace("[{0}] was imported but not moved, moving it now", file);
MoveEpisodeFile(episodeFile);
}
}
catch (Exception ex)
{
Logger.WarnException("Failed to move epiosde file from drop folder: " + file, ex);
throw;
}
}
}
private List<string> GetVideoFiles(string path)
{