Updated migration to attempt associate old grabbed & imported events and associate drone factory imports during CompletedDownloadHandling.

This commit is contained in:
Taloth Saldono
2014-05-29 00:48:37 +02:00
parent 1b96a43037
commit 1a63b1caba
8 changed files with 331 additions and 101 deletions

View File

@@ -25,6 +25,7 @@ namespace NzbDrone.Core.History
History MostRecentForEpisode(int episodeId);
History Get(int id);
List<History> FindBySourceTitle(string sourceTitle);
void UpdateHistoryData(Int32 historyId, Dictionary<String, String> data);
}
public class HistoryService : IHistoryService, IHandle<EpisodeGrabbedEvent>, IHandle<EpisodeImportedEvent>, IHandle<DownloadFailedEvent>
@@ -101,6 +102,13 @@ namespace NzbDrone.Core.History
.FirstOrDefault();
}
public void UpdateHistoryData(Int32 historyId, Dictionary<String, String> data)
{
var history = _historyRepository.Get(historyId);
history.Data = data;
_historyRepository.Update(history);
}
public void Handle(EpisodeGrabbedEvent message)
{
foreach (var episode in message.Episode.Episodes)