Revert "Fixed: Prevent false notification for moving artist when editing"

This reverts commit 0133f4331b.
pull/4345/head
Bogdan 1 year ago
parent 0133f4331b
commit 0655a9aa72

@ -167,8 +167,6 @@ namespace Lidarr.Api.V1.Artist
{ {
var artist = _artistService.GetArtist(artistResource.Id); var artist = _artistService.GetArtist(artistResource.Id);
if (moveFiles)
{
var sourcePath = artist.Path; var sourcePath = artist.Path;
var destinationPath = artistResource.Path; var destinationPath = artistResource.Path;
@ -177,9 +175,9 @@ namespace Lidarr.Api.V1.Artist
ArtistId = artist.Id, ArtistId = artist.Id,
SourcePath = sourcePath, SourcePath = sourcePath,
DestinationPath = destinationPath, DestinationPath = destinationPath,
MoveFiles = moveFiles,
Trigger = CommandTrigger.Manual Trigger = CommandTrigger.Manual
}); });
}
var model = artistResource.ToModel(artist); var model = artistResource.ToModel(artist);

@ -79,12 +79,13 @@ namespace Lidarr.Api.V1.Artist
} }
} }
if (resource.MoveFiles && artistToMove.Any()) if (artistToMove.Any())
{ {
_commandQueueManager.Push(new BulkMoveArtistCommand _commandQueueManager.Push(new BulkMoveArtistCommand
{ {
DestinationRootFolder = resource.RootFolderPath, DestinationRootFolder = resource.RootFolderPath,
Artist = artistToMove Artist = artistToMove,
MoveFiles = resource.MoveFiles
}); });
} }

@ -8,6 +8,7 @@ namespace NzbDrone.Core.Music.Commands
{ {
public List<BulkMoveArtist> Artist { get; set; } public List<BulkMoveArtist> Artist { get; set; }
public string DestinationRootFolder { get; set; } public string DestinationRootFolder { get; set; }
public bool MoveFiles { get; set; }
public override bool SendUpdatesToClient => true; public override bool SendUpdatesToClient => true;
public override bool RequiresDiskAccess => true; public override bool RequiresDiskAccess => true;

@ -7,6 +7,7 @@ namespace NzbDrone.Core.Music.Commands
public int ArtistId { get; set; } public int ArtistId { get; set; }
public string SourcePath { get; set; } public string SourcePath { get; set; }
public string DestinationPath { get; set; } public string DestinationPath { get; set; }
public bool MoveFiles { get; set; }
public override bool SendUpdatesToClient => true; public override bool SendUpdatesToClient => true;
public override bool RequiresDiskAccess => true; public override bool RequiresDiskAccess => true;

@ -38,7 +38,7 @@ namespace NzbDrone.Core.Music
_logger = logger; _logger = logger;
} }
private void MoveSingleArtist(Artist artist, string sourcePath, string destinationPath, int? index = null, int? total = null) private void MoveSingleArtist(Artist artist, string sourcePath, string destinationPath, bool moveFiles, int? index = null, int? total = null)
{ {
if (!_diskProvider.FolderExists(sourcePath)) if (!_diskProvider.FolderExists(sourcePath))
{ {
@ -56,6 +56,8 @@ namespace NzbDrone.Core.Music
} }
try try
{
if (moveFiles)
{ {
_rootFolderWatchingService.ReportFileSystemChangeBeginning(sourcePath, destinationPath); _rootFolderWatchingService.ReportFileSystemChangeBeginning(sourcePath, destinationPath);
@ -65,6 +67,7 @@ namespace NzbDrone.Core.Music
_diskTransferService.TransferFolder(sourcePath, destinationPath, TransferMode.Move); _diskTransferService.TransferFolder(sourcePath, destinationPath, TransferMode.Move);
_logger.ProgressInfo("{0} moved successfully to {1}", artist.Name, destinationPath); _logger.ProgressInfo("{0} moved successfully to {1}", artist.Name, destinationPath);
}
_eventAggregator.PublishEvent(new ArtistMovedEvent(artist, sourcePath, destinationPath)); _eventAggregator.PublishEvent(new ArtistMovedEvent(artist, sourcePath, destinationPath));
} }
@ -88,7 +91,7 @@ namespace NzbDrone.Core.Music
{ {
var artist = _artistService.GetArtist(message.ArtistId); var artist = _artistService.GetArtist(message.ArtistId);
MoveSingleArtist(artist, message.SourcePath, message.DestinationPath); MoveSingleArtist(artist, message.SourcePath, message.DestinationPath, message.MoveFiles);
} }
public void Execute(BulkMoveArtistCommand message) public void Execute(BulkMoveArtistCommand message)
@ -104,7 +107,7 @@ namespace NzbDrone.Core.Music
var artist = _artistService.GetArtist(s.ArtistId); var artist = _artistService.GetArtist(s.ArtistId);
var destinationPath = Path.Combine(destinationRootFolder, _filenameBuilder.GetArtistFolder(artist)); var destinationPath = Path.Combine(destinationRootFolder, _filenameBuilder.GetArtistFolder(artist));
MoveSingleArtist(artist, s.SourcePath, destinationPath, index, artistToMove.Count); MoveSingleArtist(artist, s.SourcePath, destinationPath, message.MoveFiles, index, artistToMove.Count);
} }
_logger.ProgressInfo("Finished moving {0} artist to '{1}'", artistToMove.Count, destinationRootFolder); _logger.ProgressInfo("Finished moving {0} artist to '{1}'", artistToMove.Count, destinationRootFolder);

Loading…
Cancel
Save