1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2025-02-25 07:32:56 +00:00

Don't even call update if list cleaning disabled

This commit is contained in:
Qstick 2020-08-02 02:02:46 -04:00
parent 0bb5dfc3d2
commit 41fc244bda
2 changed files with 31 additions and 29 deletions

View file

@ -116,7 +116,7 @@ public void should_not_clean_library_if_config_value_disable()
.Verify(v => v.GetAllMovies(), Times.Never());
Mocker.GetMock<IMovieService>()
.Verify(v => v.UpdateMovie(new List<Movie>(), true), Times.Once());
.Verify(v => v.UpdateMovie(new List<Movie>(), true), Times.Never());
}
[Test]

View file

@ -161,8 +161,11 @@ private void CleanLibrary(List<Movie> movies)
{
var moviesToUpdate = new List<Movie>();
if (_configService.ListSyncLevel != "disabled")
if (_configService.ListSyncLevel == "disabled")
{
return;
}
var moviesInLibrary = _movieService.GetAllMovies();
foreach (var movie in moviesInLibrary)
{
@ -195,7 +198,6 @@ private void CleanLibrary(List<Movie> movies)
}
}
}
}
_movieService.UpdateMovie(moviesToUpdate, true);
}