mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Fix History not picking up imported movie.
This commit is contained in:
parent
8fa43fb9f7
commit
eb46343ce8
1 changed files with 40 additions and 0 deletions
|
@ -31,6 +31,7 @@ namespace NzbDrone.Core.History
|
||||||
public class HistoryService : IHistoryService,
|
public class HistoryService : IHistoryService,
|
||||||
IHandle<EpisodeGrabbedEvent>,
|
IHandle<EpisodeGrabbedEvent>,
|
||||||
IHandle<MovieGrabbedEvent>,
|
IHandle<MovieGrabbedEvent>,
|
||||||
|
IHandle<MovieImportedEvent>,
|
||||||
IHandle<EpisodeImportedEvent>,
|
IHandle<EpisodeImportedEvent>,
|
||||||
IHandle<DownloadFailedEvent>,
|
IHandle<DownloadFailedEvent>,
|
||||||
IHandle<EpisodeFileDeletedEvent>,
|
IHandle<EpisodeFileDeletedEvent>,
|
||||||
|
@ -264,6 +265,45 @@ namespace NzbDrone.Core.History
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Handle(MovieImportedEvent message)
|
||||||
|
{
|
||||||
|
if (!message.NewDownload)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var downloadId = message.DownloadId;
|
||||||
|
|
||||||
|
if (downloadId.IsNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
//downloadId = FindDownloadId(message); For now fuck off.
|
||||||
|
}
|
||||||
|
|
||||||
|
var movie = message.MovieInfo.Movie;
|
||||||
|
var history = new History
|
||||||
|
{
|
||||||
|
EventType = HistoryEventType.DownloadFolderImported,
|
||||||
|
Date = DateTime.UtcNow,
|
||||||
|
Quality = message.MovieInfo.Quality,
|
||||||
|
SourceTitle = movie.Title,
|
||||||
|
SeriesId = 0,
|
||||||
|
EpisodeId = 0,
|
||||||
|
DownloadId = downloadId,
|
||||||
|
MovieId = movie.Id,
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//Won't have a value since we publish this event before saving to DB.
|
||||||
|
//history.Data.Add("FileId", message.ImportedEpisode.Id.ToString());
|
||||||
|
history.Data.Add("DroppedPath", message.MovieInfo.Path);
|
||||||
|
history.Data.Add("ImportedPath", Path.Combine(movie.Path, message.ImportedMovie.RelativePath));
|
||||||
|
history.Data.Add("DownloadClient", message.DownloadClient);
|
||||||
|
|
||||||
|
_historyRepository.Insert(history);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void Handle(DownloadFailedEvent message)
|
public void Handle(DownloadFailedEvent message)
|
||||||
{
|
{
|
||||||
foreach (var episodeId in message.EpisodeIds)
|
foreach (var episodeId in message.EpisodeIds)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue