mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Fix: Successful downloads that are not moved properly should be retried.
This commit is contained in:
parent
5650f891ee
commit
c0d1d2c502
6 changed files with 170 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue