mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
New: Rescan movie if destination file already exists during import
Closes #8230 Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
This commit is contained in:
parent
5727e7c43b
commit
f2bf494cef
@ -8,9 +8,10 @@
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Extras;
|
||||
using NzbDrone.Core.History;
|
||||
using NzbDrone.Core.MediaFiles.Commands;
|
||||
using NzbDrone.Core.MediaFiles.Events;
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
using NzbDrone.Core.Messaging.Events;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Qualities;
|
||||
|
||||
@ -29,6 +30,7 @@ public class ImportApprovedMovie : IImportApprovedMovie
|
||||
private readonly IDiskProvider _diskProvider;
|
||||
private readonly IHistoryService _historyService;
|
||||
private readonly IEventAggregator _eventAggregator;
|
||||
private readonly IManageCommandQueue _commandQueueManager;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public ImportApprovedMovie(IUpgradeMediaFiles movieFileUpgrader,
|
||||
@ -37,6 +39,7 @@ public ImportApprovedMovie(IUpgradeMediaFiles movieFileUpgrader,
|
||||
IDiskProvider diskProvider,
|
||||
IHistoryService historyService,
|
||||
IEventAggregator eventAggregator,
|
||||
IManageCommandQueue commandQueueManager,
|
||||
Logger logger)
|
||||
{
|
||||
_movieFileUpgrader = movieFileUpgrader;
|
||||
@ -45,6 +48,7 @@ public ImportApprovedMovie(IUpgradeMediaFiles movieFileUpgrader,
|
||||
_diskProvider = diskProvider;
|
||||
_historyService = historyService;
|
||||
_eventAggregator = eventAggregator;
|
||||
_commandQueueManager = commandQueueManager;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
@ -157,6 +161,8 @@ public List<ImportResult> Import(List<ImportDecision> decisions, bool newDownloa
|
||||
{
|
||||
_logger.Warn(e, "Couldn't import movie " + localMovie);
|
||||
importResults.Add(new ImportResult(importDecision, "Failed to import movie, Destination already exists."));
|
||||
|
||||
_commandQueueManager.Push(new RescanMovieCommand(localMovie.Movie.Id));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user