|
|
@ -232,6 +232,10 @@ namespace NzbDrone.Core.Providers
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var file in files)
|
|
|
|
foreach (var file in files)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Parse the filename
|
|
|
|
//Parse the filename
|
|
|
|
var parseResult = Parser.ParseEpisodeInfo(Path.GetFileName(file));
|
|
|
|
var parseResult = Parser.ParseEpisodeInfo(Path.GetFileName(file));
|
|
|
|
parseResult.Series = series;
|
|
|
|
parseResult.Series = series;
|
|
|
@ -270,7 +274,12 @@ namespace NzbDrone.Core.Providers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Delete the files and then cleanup!
|
|
|
|
//Delete the files and then cleanup!
|
|
|
|
episodeFilesToClean.ForEach(e => _diskProvider.DeleteFile(e.Path));
|
|
|
|
foreach (var e in episodeFilesToClean)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (_diskProvider.FileExists(e.Path))
|
|
|
|
|
|
|
|
_diskProvider.DeleteFile(e.Path);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CleanUp(episodeFilesToClean);
|
|
|
|
CleanUp(episodeFilesToClean);
|
|
|
|
|
|
|
|
|
|
|
|
//Move the file
|
|
|
|
//Move the file
|
|
|
@ -280,6 +289,12 @@ namespace NzbDrone.Core.Providers
|
|
|
|
result.Add(ImportFile(series, folder + filename));
|
|
|
|
result.Add(ImportFile(series, folder + filename));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Logger.WarnException("Error importing new download: " + file, ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//If we have imported all the non-sample files, delete the folder, requires a minimum of 1 file to be imported.
|
|
|
|
//If we have imported all the non-sample files, delete the folder, requires a minimum of 1 file to be imported.
|
|
|
|
if (files.Count() > 0 && files.Count() == result.Count)
|
|
|
|
if (files.Count() > 0 && files.Count() == result.Count)
|
|
|
|
{
|
|
|
|
{
|
|
|
|