1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-11 12:02:35 +02:00

New: Don't clean moves if IMDB Match

This commit is contained in:
Qstick 2019-12-29 23:08:11 -05:00
parent b1b6a91db8
commit c300af8241

View File

@ -135,7 +135,12 @@ public void Execute(NetImportSyncCommand message)
foreach (var movie in listedMovies)
{
var mapped = _movieSearch.MapMovieToTmdbMovie(movie);
var mapped = movie;
if (mapped.TmdbId == 0)
{
mapped = _movieSearch.MapMovieToTmdbMovie(movie);
}
if (mapped != null && mapped.TmdbId > 0)
{
@ -169,22 +174,15 @@ public void Execute(NetImportSyncCommand message)
private void CleanLibrary(List<Movie> movies)
{
var moviesToUpdate = new List<Movie>();
if (_configService.ListSyncLevel != "disabled")
{
var moviesInLibrary = _movieService.GetAllMovies();
foreach (var movie in moviesInLibrary)
{
bool foundMatch = false;
foreach (var listedMovie in movies)
{
if (movie.TmdbId == listedMovie.TmdbId)
{
foundMatch = true;
break;
}
}
var movieExists = movies.Any(c => c.TmdbId == movie.TmdbId || c.ImdbId == movie.ImdbId);
if (!foundMatch)
if (!movieExists)
{
switch (_configService.ListSyncLevel)
{