Skip to content

Commit

Permalink
Fixed: Skip move when source and destination are the same
Browse files Browse the repository at this point in the history
Co-Authored-By: Colin Hebert <makkhdyn@gmail.com>
  • Loading branch information
Qstick and Colin Hebert committed Jul 10, 2023
1 parent ae88201 commit 7a5ae56
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/NzbDrone.Core/Movies/MoveMovieService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.IO;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Messaging.Events;
Expand Down Expand Up @@ -51,6 +52,12 @@ private void MoveSingleMovie(Movie movie, string sourcePath, string destinationP
_logger.ProgressInfo("Moving {0} from '{1}' to '{2}'", movie.Title, sourcePath, destinationPath);
}

if (sourcePath.PathEquals(destinationPath))
{
_logger.ProgressInfo("{0} is already in the specified location '{1}'.", movie, destinationPath);
return;
}

try
{
_diskProvider.CreateFolder(new DirectoryInfo(destinationPath).Parent.FullName);
Expand Down

0 comments on commit 7a5ae56

Please sign in to comment.