public void Handle(AlbumImportIncompleteEvent message) { // TODO: Build out this message so that we can pass on what failed and what was successful var downloadMessage = new AlbumDownloadMessage { Message = GetAlbumIncompleteImportMessage(message.TrackedDownload.DownloadItem.Title), }; foreach (var notification in _notificationFactory.OnImportFailureEnabled()) { if (ShouldHandleArtist(notification.Definition, message.TrackedDownload.RemoteAlbum.Artist)) { notification.OnImportFailure(downloadMessage); } } }
public void Handle(AlbumImportIncompleteEvent message) { foreach (var album in message.TrackedDownload.RemoteAlbum.Albums) { var history = new History { EventType = HistoryEventType.AlbumImportIncomplete, Date = DateTime.UtcNow, Quality = message.TrackedDownload.RemoteAlbum.ParsedAlbumInfo?.Quality ?? new QualityModel(), SourceTitle = message.TrackedDownload.DownloadItem.Title, ArtistId = album.ArtistId, AlbumId = album.Id, DownloadId = message.TrackedDownload.DownloadItem.DownloadId }; history.Data.Add("StatusMessages", message.TrackedDownload.StatusMessages.ToJson()); _historyRepository.Insert(history); } }