Less logging when no import lists are enabled

(cherry picked from commit 7be4840f028f24e3920bd395a4e15eb5e643e46f)

Closes #9040
This commit is contained in:
Mark McDowall 2023-08-18 23:47:19 -07:00 committed by Bogdan
parent 1d488df242
commit 3244282a83
1 changed files with 19 additions and 19 deletions

View File

@ -41,36 +41,37 @@ namespace NzbDrone.Core.ImportLists
_configService = configService;
}
private void SyncList(ImportListDefinition definition)
{
_logger.ProgressInfo(string.Format("Starting Import List Refresh for List {0}", definition.Name));
var result = _listFetcherAndParser.FetchSingleList(definition);
ProcessReports(result);
}
private void SyncAll()
{
var result = _listFetcherAndParser.Fetch();
if (_importListFactory.Enabled().Where(a => ((ImportListDefinition)a.Definition).EnableAuto).Empty())
{
_logger.Info("No auto enabled lists, skipping sync and cleaning");
_logger.Debug("No import lists with automatic add enabled, skipping sync and cleaning");
return;
}
if (result.SyncedLists == 0)
var listItemsResult = _listFetcherAndParser.Fetch();
if (listItemsResult.SyncedLists == 0)
{
return;
}
if (!result.AnyFailure)
if (!listItemsResult.AnyFailure)
{
CleanLibrary();
}
ProcessReports(result);
ProcessListItems(listItemsResult);
}
private void SyncList(ImportListDefinition definition)
{
_logger.ProgressInfo("Starting Import List Refresh for List {0}", definition.Name);
var listItemsResult = _listFetcherAndParser.FetchSingleList(definition);
ProcessListItems(listItemsResult);
}
private void ProcessMovieReport(ImportListDefinition importList, ImportListMovie report, List<ImportExclusion> listExclusions, List<int> dbMovies, List<Movie> moviesToAdd)
@ -122,7 +123,7 @@ namespace NzbDrone.Core.ImportLists
}
}
private void ProcessReports(ImportListFetchResult listFetchResult)
private void ProcessListItems(ImportListFetchResult listFetchResult)
{
listFetchResult.Movies = listFetchResult.Movies.DistinctBy(x =>
{
@ -162,10 +163,9 @@ namespace NzbDrone.Core.ImportLists
if (moviesToAdd.Any())
{
_logger.Info($"Adding {moviesToAdd.Count} movies from your auto enabled lists to library");
_logger.ProgressInfo("Adding {0} movies from your auto enabled lists to library", moviesToAdd.Count);
_addMovieService.AddMovies(moviesToAdd, true);
}
_addMovieService.AddMovies(moviesToAdd, true);
}
public void Execute(ImportListSyncCommand message)