mirror of
https://github.com/Radarr/Radarr
synced 2025-02-23 14:51:17 +00:00
Avoid using GetAllMovies in MediaFileDeletionService
This commit is contained in:
parent
1c99ce8876
commit
bbde1dc7a6
1 changed files with 4 additions and 4 deletions
|
@ -92,24 +92,24 @@ public void HandleAsync(MoviesDeletedEvent message)
|
||||||
{
|
{
|
||||||
if (message.DeleteFiles)
|
if (message.DeleteFiles)
|
||||||
{
|
{
|
||||||
var allMovies = _movieService.GetAllMovies();
|
var allMovies = _movieService.AllMoviePaths();
|
||||||
|
|
||||||
foreach (var movie in message.Movies)
|
foreach (var movie in message.Movies)
|
||||||
{
|
{
|
||||||
foreach (var s in allMovies)
|
foreach (var s in allMovies)
|
||||||
{
|
{
|
||||||
if (s.Id == movie.Id)
|
if (s.Key == movie.Id)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (movie.Path.IsParentPath(s.Path))
|
if (movie.Path.IsParentPath(s.Value))
|
||||||
{
|
{
|
||||||
_logger.Error("Movie path: '{0}' is a parent of another movie, not deleting files.", movie.Path);
|
_logger.Error("Movie path: '{0}' is a parent of another movie, not deleting files.", movie.Path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (movie.Path.PathEquals(s.Path))
|
if (movie.Path.PathEquals(s.Value))
|
||||||
{
|
{
|
||||||
_logger.Error("Movie path: '{0}' is the same as another movie, not deleting files.", movie.Path);
|
_logger.Error("Movie path: '{0}' is the same as another movie, not deleting files.", movie.Path);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue