mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Refactored the shit out of PostDownloadProvider
This commit is contained in:
parent
35e44284c0
commit
ec08436587
12 changed files with 323 additions and 576 deletions
|
@ -60,7 +60,7 @@ namespace NzbDrone.Core.Providers
|
|||
|
||||
if (!_diskProvider.FolderExists(path))
|
||||
{
|
||||
Logger. Warn("Series folder doesn't exist: {0}", path);
|
||||
Logger.Warn("Series folder doesn't exist: {0}", path);
|
||||
return new List<EpisodeFile>();
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,9 @@ namespace NzbDrone.Core.Providers
|
|||
{
|
||||
var file = ImportFile(series, filePath);
|
||||
if (file != null)
|
||||
{
|
||||
importedFiles.Add(file);
|
||||
}
|
||||
}
|
||||
|
||||
series.LastDiskSync = DateTime.Now;
|
||||
|
@ -153,7 +155,7 @@ namespace NzbDrone.Core.Providers
|
|||
foreach (var ep in episodes)
|
||||
{
|
||||
ep.EpisodeFileId = fileId;
|
||||
ep.PostDownloadStatus = PostDownloadStatusType.Processed;
|
||||
ep.PostDownloadStatus = PostDownloadStatusType.NoError;
|
||||
_episodeProvider.UpdateEpisode(ep);
|
||||
Logger.Debug("Linking [{0}] > [{1}]", filePath, ep);
|
||||
}
|
||||
|
@ -191,12 +193,15 @@ namespace NzbDrone.Core.Providers
|
|||
parseResult.Series = series;
|
||||
|
||||
var message = _sabProvider.GetSabTitle(parseResult);
|
||||
|
||||
if (newDownload)
|
||||
_externalNotificationProvider.OnDownload(message, series);
|
||||
|
||||
if (newDownload)
|
||||
{
|
||||
_externalNotificationProvider.OnDownload(message, series);
|
||||
}
|
||||
else
|
||||
{
|
||||
_externalNotificationProvider.OnRename(message, series);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue