mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Fixed: Backend Updates from Sonarr
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com> Co-Authored-By: taloth <taloth@users.noreply.github.com>
This commit is contained in:
@@ -35,6 +35,7 @@ namespace NzbDrone.Core.History
|
||||
IHandle<MovieImportedEvent>,
|
||||
IHandle<DownloadFailedEvent>,
|
||||
IHandle<MovieFileDeletedEvent>,
|
||||
IHandle<MovieFileRenamedEvent>,
|
||||
IHandle<MovieDeletedEvent>
|
||||
{
|
||||
private readonly IHistoryRepository _historyRepository;
|
||||
@@ -195,6 +196,30 @@ namespace NzbDrone.Core.History
|
||||
_historyRepository.Insert(history);
|
||||
}
|
||||
|
||||
public void Handle(MovieFileRenamedEvent message)
|
||||
{
|
||||
var sourcePath = message.OriginalPath;
|
||||
var sourceRelativePath = message.Movie.Path.GetRelativePath(message.OriginalPath);
|
||||
var path = Path.Combine(message.Movie.Path, message.MovieFile.RelativePath);
|
||||
var relativePath = message.MovieFile.RelativePath;
|
||||
|
||||
var history = new History
|
||||
{
|
||||
EventType = HistoryEventType.MovieFileRenamed,
|
||||
Date = DateTime.UtcNow,
|
||||
Quality = message.MovieFile.Quality,
|
||||
SourceTitle = message.OriginalPath,
|
||||
MovieId = message.MovieFile.MovieId,
|
||||
};
|
||||
|
||||
history.Data.Add("SourcePath", sourcePath);
|
||||
history.Data.Add("SourceRelativePath", sourceRelativePath);
|
||||
history.Data.Add("Path", path);
|
||||
history.Data.Add("RelativePath", relativePath);
|
||||
|
||||
_historyRepository.Insert(history);
|
||||
}
|
||||
|
||||
public void Handle(MovieDeletedEvent message)
|
||||
{
|
||||
_historyRepository.DeleteForMovie(message.Movie.Id);
|
||||
|
Reference in New Issue
Block a user