diff --git a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadClientFixtureBase.cs b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadClientFixtureBase.cs index 17f8b1787..3915cddac 100644 --- a/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadClientFixtureBase.cs +++ b/src/NzbDrone.Core.Test/Download/DownloadClientTests/DownloadClientFixtureBase.cs @@ -60,7 +60,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests protected void VerifyIdentifiable(DownloadClientItem downloadClientItem) { - downloadClientItem.DownloadClient.Should().Be(Subject.Definition.Name); + downloadClientItem.DownloadClientInfo.Protocol.Should().Be(Subject.Protocol); + downloadClientItem.DownloadClientInfo.Id.Should().Be(Subject.Definition.Id); + downloadClientItem.DownloadClientInfo.Name.Should().Be(Subject.Definition.Name); downloadClientItem.DownloadId.Should().NotBeNullOrEmpty(); downloadClientItem.Title.Should().NotBeNullOrEmpty(); } diff --git a/src/NzbDrone.Core.Test/Download/TrackedDownloads/TrackedDownloadServiceFixture.cs b/src/NzbDrone.Core.Test/Download/TrackedDownloads/TrackedDownloadServiceFixture.cs index 9246c195d..559152fdc 100644 --- a/src/NzbDrone.Core.Test/Download/TrackedDownloads/TrackedDownloadServiceFixture.cs +++ b/src/NzbDrone.Core.Test/Download/TrackedDownloads/TrackedDownloadServiceFixture.cs @@ -64,6 +64,12 @@ namespace NzbDrone.Core.Test.Download.TrackedDownloads { Title = "The torrent release folder", DownloadId = "35238", + DownloadClientInfo = new DownloadClientItemClientInfo + { + Protocol = client.Protocol, + Id = client.Id, + Name = client.Name + } }; var trackedDownload = Subject.TrackDownload(client, item); @@ -105,6 +111,12 @@ namespace NzbDrone.Core.Test.Download.TrackedDownloads { Title = "Audio Artist - Audio Album [2018 - FLAC]", DownloadId = "35238", + DownloadClientInfo = new DownloadClientItemClientInfo + { + Protocol = client.Protocol, + Id = client.Id, + Name = client.Name + } }; // get a tracked download in place diff --git a/src/NzbDrone.Core.Test/HealthCheck/Checks/RemotePathMappingCheckFixture.cs b/src/NzbDrone.Core.Test/HealthCheck/Checks/RemotePathMappingCheckFixture.cs index 3f40ce639..8a9ea3d48 100644 --- a/src/NzbDrone.Core.Test/HealthCheck/Checks/RemotePathMappingCheckFixture.cs +++ b/src/NzbDrone.Core.Test/HealthCheck/Checks/RemotePathMappingCheckFixture.cs @@ -9,6 +9,7 @@ using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Core.Download; using NzbDrone.Core.Download.Clients; using NzbDrone.Core.HealthCheck.Checks; +using NzbDrone.Core.Indexers; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles.Events; using NzbDrone.Core.Parser.Model; @@ -39,7 +40,12 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks { _downloadItem = new DownloadClientItem { - DownloadClient = "Test", + DownloadClientInfo = new DownloadClientItemClientInfo + { + Protocol = DownloadProtocol.Usenet, + Id = 1, + Name = "Test" + }, DownloadId = "TestId", OutputPath = new OsPath(_downloadItemPath) }; @@ -166,7 +172,7 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks public void should_return_ok_on_track_imported_event() { GivenFolderExists(_downloadRootPath); - var importEvent = new TrackImportedEvent(new LocalTrack(), new TrackFile(), new List(), true, new DownloadClientItem()); + var importEvent = new TrackImportedEvent(new LocalTrack(), new TrackFile(), new List(), true, new DownloadClientItem { DownloadClientInfo = new DownloadClientItemClientInfo() }); Subject.Check(importEvent).ShouldBeOk(); } @@ -180,7 +186,7 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks }; GivenFileExists(localTrack.Path); - var importEvent = new TrackImportFailedEvent(new Exception(), localTrack, true, new DownloadClientItem()); + var importEvent = new TrackImportFailedEvent(new Exception(), localTrack, true, new DownloadClientItem { DownloadClientInfo = new DownloadClientItemClientInfo() }); Subject.Check(importEvent).ShouldBeError(wikiFragment: "permissions-error"); } diff --git a/src/NzbDrone.Core.Test/HistoryTests/HistoryServiceFixture.cs b/src/NzbDrone.Core.Test/HistoryTests/HistoryServiceFixture.cs index 051cc98cf..a029efeeb 100644 --- a/src/NzbDrone.Core.Test/HistoryTests/HistoryServiceFixture.cs +++ b/src/NzbDrone.Core.Test/HistoryTests/HistoryServiceFixture.cs @@ -6,6 +6,7 @@ using Moq; using NUnit.Framework; using NzbDrone.Core.Download; using NzbDrone.Core.History; +using NzbDrone.Core.Indexers; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles.Events; using NzbDrone.Core.Music; @@ -58,7 +59,12 @@ namespace NzbDrone.Core.Test.HistoryTests var downloadClientItem = new DownloadClientItem { - DownloadClient = "sab", + DownloadClientInfo = new DownloadClientItemClientInfo + { + Protocol = DownloadProtocol.Usenet, + Id = 1, + Name = "sab" + }, DownloadId = "abcd" }; diff --git a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedTracksFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedTracksFixture.cs index 2dc8eb36c..8437e1d76 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedTracksFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedTracksFixture.cs @@ -27,6 +27,7 @@ namespace NzbDrone.Core.Test.MediaFiles private List> _approvedDecisions; private DownloadClientItem _downloadClientItem; + private DownloadClientItemClientInfo _clientInfo; [SetUp] public void Setup() @@ -79,7 +80,8 @@ namespace NzbDrone.Core.Test.MediaFiles .Setup(s => s.UpgradeTrackFile(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new TrackFileMoveResult()); - _downloadClientItem = Builder.CreateNew().Build(); + _clientInfo = Builder.CreateNew().Build(); + _downloadClientItem = Builder.CreateNew().With(x => x.DownloadClientInfo = _clientInfo).Build(); Mocker.GetMock() .Setup(s => s.GetFilesByAlbum(It.IsAny())) @@ -187,7 +189,7 @@ namespace NzbDrone.Core.Test.MediaFiles [Test] public void should_copy_when_cannot_move_files_downloads() { - Subject.Import(new List> { _approvedDecisions.First() }, true, new DownloadClientItem { Title = "Alien.Ant.Farm-Truant", CanMoveFiles = false }); + Subject.Import(new List> { _approvedDecisions.First() }, true, new DownloadClientItem { Title = "Alien.Ant.Farm-Truant", CanMoveFiles = false, DownloadClientInfo = _clientInfo }); Mocker.GetMock() .Verify(v => v.UpgradeTrackFile(It.IsAny(), _approvedDecisions.First().Item, true), Times.Once()); @@ -196,7 +198,7 @@ namespace NzbDrone.Core.Test.MediaFiles [Test] public void should_use_override_importmode() { - Subject.Import(new List> { _approvedDecisions.First() }, true, new DownloadClientItem { Title = "Alien.Ant.Farm-Truant", CanMoveFiles = false }, ImportMode.Move); + Subject.Import(new List> { _approvedDecisions.First() }, true, new DownloadClientItem { Title = "Alien.Ant.Farm-Truant", CanMoveFiles = false, DownloadClientInfo = _clientInfo }, ImportMode.Move); Mocker.GetMock() .Verify(v => v.UpgradeTrackFile(It.IsAny(), _approvedDecisions.First().Item, false), Times.Once()); diff --git a/src/NzbDrone.Core.Test/QueueTests/QueueServiceFixture.cs b/src/NzbDrone.Core.Test/QueueTests/QueueServiceFixture.cs index 7cb205af4..f3f14cdc8 100644 --- a/src/NzbDrone.Core.Test/QueueTests/QueueServiceFixture.cs +++ b/src/NzbDrone.Core.Test/QueueTests/QueueServiceFixture.cs @@ -5,6 +5,7 @@ using FizzWare.NBuilder; using FluentAssertions; using Moq; using NUnit.Framework; +using NzbDrone.Core.Download; using NzbDrone.Core.Download.TrackedDownloads; using NzbDrone.Core.History; using NzbDrone.Core.Music; @@ -22,8 +23,11 @@ namespace NzbDrone.Core.Test.QueueTests [SetUp] public void SetUp() { + var downloadClientInfo = Builder.CreateNew().Build(); + var downloadItem = Builder.CreateNew() .With(v => v.RemainingTime = TimeSpan.FromSeconds(10)) + .With(v => v.DownloadClientInfo = downloadClientInfo) .Build(); var artist = Builder.CreateNew() diff --git a/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs b/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs index 40bdb6152..40241fd15 100644 --- a/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs +++ b/src/NzbDrone.Core/Download/Clients/Blackhole/TorrentBlackhole.cs @@ -87,7 +87,7 @@ namespace NzbDrone.Core.Download.Clients.Blackhole { yield return new DownloadClientItem { - DownloadClient = Definition.Name, + DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this), DownloadId = Definition.Name + "_" + item.DownloadId, Category = "Lidarr", Title = item.Title, diff --git a/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs b/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs index 323eeb789..21b849bb4 100644 --- a/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs +++ b/src/NzbDrone.Core/Download/Clients/Blackhole/UsenetBlackhole.cs @@ -59,7 +59,7 @@ namespace NzbDrone.Core.Download.Clients.Blackhole { yield return new DownloadClientItem { - DownloadClient = Definition.Name, + DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this), DownloadId = Definition.Name + "_" + item.DownloadId, Category = "Lidarr", Title = item.Title, diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index 31b394d86..02ce7ad0e 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -133,7 +133,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge item.Title = torrent.Name; item.Category = Settings.MusicCategory; - item.DownloadClient = Definition.Name; + item.DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this); var outputPath = _remotePathMappingService.RemapRemoteToLocal(Settings.Host, new OsPath(torrent.DownloadPath)); item.OutputPath = outputPath + torrent.Name; diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs index 6bcb1fbfe..998f68ddc 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/TorrentDownloadStation.cs @@ -85,7 +85,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation var item = new DownloadClientItem() { Category = Settings.MusicCategory, - DownloadClient = Definition.Name, + DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this), DownloadId = CreateDownloadId(torrent.Id, serialNumber), Title = torrent.Title, TotalSize = torrent.Size, diff --git a/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs b/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs index 6edc96e84..b44469699 100644 --- a/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs +++ b/src/NzbDrone.Core/Download/Clients/DownloadStation/UsenetDownloadStation.cs @@ -95,7 +95,7 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation var item = new DownloadClientItem() { Category = Settings.MusicCategory, - DownloadClient = Definition.Name, + DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this), DownloadId = CreateDownloadId(nzb.Id, serialNumber), Title = nzb.Title, TotalSize = nzb.Size, diff --git a/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs b/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs index b6b09a59c..d3f1a9b42 100644 --- a/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs +++ b/src/NzbDrone.Core/Download/Clients/Hadouken/Hadouken.cs @@ -55,7 +55,7 @@ namespace NzbDrone.Core.Download.Clients.Hadouken var item = new DownloadClientItem { - DownloadClient = Definition.Name, + DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this), DownloadId = torrent.InfoHash.ToUpper(), OutputPath = outputPath + torrent.Name, RemainingSize = torrent.TotalSize - torrent.DownloadedBytes, diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs index 8b3ae01be..70c02d117 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs @@ -56,7 +56,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex { var queueItem = new DownloadClientItem(); - queueItem.DownloadClient = Definition.Name; + queueItem.DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this); queueItem.DownloadId = vortexQueueItem.AddUUID ?? vortexQueueItem.Id.ToString(); queueItem.Category = vortexQueueItem.GroupName; queueItem.Title = vortexQueueItem.UiTitle; diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index d7de962f4..f84a5a6ef 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -72,7 +72,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget queueItem.Title = item.NzbName; queueItem.TotalSize = totalSize; queueItem.Category = item.Category; - queueItem.DownloadClient = Definition.Name; + queueItem.DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this); queueItem.CanMoveFiles = true; queueItem.CanBeRemoved = true; @@ -119,7 +119,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget var historyItem = new DownloadClientItem(); var itemDir = item.FinalDir.IsNullOrWhiteSpace() ? item.DestDir : item.FinalDir; - historyItem.DownloadClient = Definition.Name; + historyItem.DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this); historyItem.DownloadId = droneParameter == null ? item.Id.ToString() : droneParameter.Value.ToString(); historyItem.Title = item.Name; historyItem.TotalSize = MakeInt64(item.FileSizeHi, item.FileSizeLo); diff --git a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs index f8eb62cc1..2261d1359 100644 --- a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs +++ b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs @@ -72,7 +72,7 @@ namespace NzbDrone.Core.Download.Clients.Pneumatic var historyItem = new DownloadClientItem { - DownloadClient = Definition.Name, + DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this), DownloadId = GetDownloadClientId(file), Title = title, diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs index 3c311452f..219c230de 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs @@ -137,7 +137,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent Category = torrent.Category.IsNotNullOrWhiteSpace() ? torrent.Category : torrent.Label, Title = torrent.Name, TotalSize = torrent.Size, - DownloadClient = Definition.Name, + DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this), RemainingSize = (long)(torrent.Size * (1.0 - torrent.Progress)), RemainingTime = GetRemainingTime(torrent), SeedRatio = torrent.Ratio diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index 719305dc9..02498983a 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -62,7 +62,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd } var queueItem = new DownloadClientItem(); - queueItem.DownloadClient = Definition.Name; + queueItem.DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this); queueItem.DownloadId = sabQueueItem.Id; queueItem.Category = sabQueueItem.Category; queueItem.Title = sabQueueItem.Title; @@ -117,7 +117,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd var historyItem = new DownloadClientItem { - DownloadClient = Definition.Name, + DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this), DownloadId = sabHistoryItem.Id, Category = sabHistoryItem.Category, Title = sabHistoryItem.Title, diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs index 8132e24b5..254c4e2d3 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs @@ -70,7 +70,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission item.Category = Settings.MusicCategory; item.Title = torrent.Name; - item.DownloadClient = Definition.Name; + item.DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this); item.OutputPath = GetOutputPath(outputPath, torrent); item.TotalSize = torrent.TotalSize; diff --git a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs index 1abbd5d09..04b34278d 100644 --- a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs @@ -120,7 +120,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent } var item = new DownloadClientItem(); - item.DownloadClient = Definition.Name; + item.DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this); item.Title = torrent.Name; item.DownloadId = torrent.Hash; item.OutputPath = _remotePathMappingService.RemapRemoteToLocal(Settings.Host, new OsPath(torrent.Path)); diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs index 8c72ac9c1..47d0431aa 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs @@ -118,7 +118,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent item.Title = torrent.Name; item.TotalSize = torrent.Size; item.Category = torrent.Label; - item.DownloadClient = Definition.Name; + item.DownloadClientInfo = DownloadClientItemClientInfo.FromDownloadClient(this); item.RemainingSize = torrent.Remaining; item.SeedRatio = torrent.Ratio; diff --git a/src/NzbDrone.Core/Download/DownloadClientItem.cs b/src/NzbDrone.Core/Download/DownloadClientItem.cs index ef890244c..88b04e0fe 100644 --- a/src/NzbDrone.Core/Download/DownloadClientItem.cs +++ b/src/NzbDrone.Core/Download/DownloadClientItem.cs @@ -2,13 +2,14 @@ using System; using System.Diagnostics; using NzbDrone.Common.Disk; using NzbDrone.Core.Indexers; +using NzbDrone.Core.ThingiProvider; namespace NzbDrone.Core.Download { - [DebuggerDisplay("{DownloadClient}:{Title}")] + [DebuggerDisplay("{DownloadClientName}:{Title}")] public class DownloadClientItem { - public string DownloadClient { get; set; } + public DownloadClientItemClientInfo DownloadClientInfo { get; set; } public string DownloadId { get; set; } public string Category { get; set; } public string Title { get; set; } @@ -17,13 +18,10 @@ namespace NzbDrone.Core.Download public long RemainingSize { get; set; } public TimeSpan? RemainingTime { get; set; } public double? SeedRatio { get; set; } - public OsPath OutputPath { get; set; } public string Message { get; set; } - public DownloadItemStatus Status { get; set; } public bool IsEncrypted { get; set; } - public bool CanMoveFiles { get; set; } public bool CanBeRemoved { get; set; } public bool Removed { get; set; } @@ -41,6 +39,16 @@ namespace NzbDrone.Core.Download public int Id { get; set; } public string Name { get; set; } - public bool Removed { get; set; } + public static DownloadClientItemClientInfo FromDownloadClient(DownloadClientBase downloadClient) + where TSettings : IProviderConfig, new() + { + return new DownloadClientItemClientInfo + { + Protocol = downloadClient.Protocol, + Type = downloadClient.Name, + Id = downloadClient.Definition.Id, + Name = downloadClient.Definition.Name + }; + } } } diff --git a/src/NzbDrone.Core/Download/DownloadEventHub.cs b/src/NzbDrone.Core/Download/DownloadEventHub.cs index e75fdbc1f..ef219a3a0 100644 --- a/src/NzbDrone.Core/Download/DownloadEventHub.cs +++ b/src/NzbDrone.Core/Download/DownloadEventHub.cs @@ -61,7 +61,7 @@ namespace NzbDrone.Core.Download var downloadClient = _downloadClientProvider.Get(trackedDownload.DownloadClient); try { - _logger.Debug("[{0}] Removing download from {1} history", trackedDownload.DownloadItem.Title, trackedDownload.DownloadItem.DownloadClient); + _logger.Debug("[{0}] Removing download from {1} history", trackedDownload.DownloadItem.Title, trackedDownload.DownloadItem.DownloadClientInfo.Name); downloadClient.RemoveItem(trackedDownload.DownloadItem.DownloadId, true); trackedDownload.DownloadItem.Removed = true; } @@ -80,7 +80,7 @@ namespace NzbDrone.Core.Download var downloadClient = _downloadClientProvider.Get(trackedDownload.DownloadClient); try { - _logger.Debug("[{0}] Marking download as imported from {1}", trackedDownload.DownloadItem.Title, trackedDownload.DownloadItem.DownloadClient); + _logger.Debug("[{0}] Marking download as imported from {1}", trackedDownload.DownloadItem.Title, trackedDownload.DownloadItem.DownloadClientInfo.Name); downloadClient.MarkItemAsImported(trackedDownload.DownloadItem); } catch (NotSupportedException e) diff --git a/src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs b/src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs index 7373266a7..ca999c88e 100644 --- a/src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs +++ b/src/NzbDrone.Core/Download/DownloadIgnoredEvent.cs @@ -10,7 +10,7 @@ namespace NzbDrone.Core.Download public List AlbumIds { get; set; } public QualityModel Quality { get; set; } public string SourceTitle { get; set; } - public string DownloadClient { get; set; } + public DownloadClientItemClientInfo DownloadClientInfo { get; set; } public string DownloadId { get; set; } public string Message { get; set; } } diff --git a/src/NzbDrone.Core/Download/IgnoredDownloadService.cs b/src/NzbDrone.Core/Download/IgnoredDownloadService.cs index ecc051162..ceaea619d 100644 --- a/src/NzbDrone.Core/Download/IgnoredDownloadService.cs +++ b/src/NzbDrone.Core/Download/IgnoredDownloadService.cs @@ -35,15 +35,15 @@ namespace NzbDrone.Core.Download } var downloadIgnoredEvent = new DownloadIgnoredEvent - { - ArtistId = artist.Id, - AlbumIds = albums.Select(e => e.Id).ToList(), - Quality = trackedDownload.RemoteAlbum.ParsedAlbumInfo.Quality, - SourceTitle = trackedDownload.DownloadItem.Title, - DownloadClient = trackedDownload.DownloadItem.DownloadClient, - DownloadId = trackedDownload.DownloadItem.DownloadId, - Message = "Manually ignored" - }; + { + ArtistId = artist.Id, + AlbumIds = albums.Select(e => e.Id).ToList(), + Quality = trackedDownload.RemoteAlbum.ParsedAlbumInfo.Quality, + SourceTitle = trackedDownload.DownloadItem.Title, + DownloadClientInfo = trackedDownload.DownloadItem.DownloadClientInfo, + DownloadId = trackedDownload.DownloadItem.DownloadId, + Message = "Manually ignored" + }; _eventAggregator.PublishEvent(downloadIgnoredEvent); return true; diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs index 2d7f81281..0874068af 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/TrackedDownloadService.cs @@ -232,7 +232,7 @@ namespace NzbDrone.Core.Download.TrackedDownloads existingItem.CanMoveFiles != downloadItem.CanMoveFiles) { _logger.Debug("Tracking '{0}:{1}': ClientState={2}{3} LidarrStage={4} Album='{5}' OutputPath={6}.", - downloadItem.DownloadClient, + downloadItem.DownloadClientInfo.Name, downloadItem.Title, downloadItem.Status, downloadItem.CanBeRemoved ? "" : downloadItem.CanMoveFiles ? " (busy)" : " (readonly)", diff --git a/src/NzbDrone.Core/History/HistoryService.cs b/src/NzbDrone.Core/History/HistoryService.cs index d4e7d8dc1..816c67cb5 100644 --- a/src/NzbDrone.Core/History/HistoryService.cs +++ b/src/NzbDrone.Core/History/HistoryService.cs @@ -386,7 +386,7 @@ namespace NzbDrone.Core.History DownloadId = message.DownloadId }; - history.Data.Add("DownloadClient", message.DownloadClient); + history.Data.Add("DownloadClient", message.DownloadClientInfo.Name); history.Data.Add("Message", message.Message); historyToAdd.Add(history); diff --git a/src/NzbDrone.Core/MediaFiles/Events/AlbumImportedEvent.cs b/src/NzbDrone.Core/MediaFiles/Events/AlbumImportedEvent.cs index d2fed1aeb..02978c2c9 100644 --- a/src/NzbDrone.Core/MediaFiles/Events/AlbumImportedEvent.cs +++ b/src/NzbDrone.Core/MediaFiles/Events/AlbumImportedEvent.cs @@ -27,7 +27,7 @@ namespace NzbDrone.Core.MediaFiles.Events if (downloadClientItem != null) { - DownloadClient = downloadClientItem.DownloadClient; + DownloadClient = downloadClientItem.DownloadClientInfo.Name; DownloadId = downloadClientItem.DownloadId; } } diff --git a/src/NzbDrone.Core/MediaFiles/Events/TrackImportFailedEvent.cs b/src/NzbDrone.Core/MediaFiles/Events/TrackImportFailedEvent.cs index 6a6c0f8bf..6f8e27dfa 100644 --- a/src/NzbDrone.Core/MediaFiles/Events/TrackImportFailedEvent.cs +++ b/src/NzbDrone.Core/MediaFiles/Events/TrackImportFailedEvent.cs @@ -21,7 +21,7 @@ namespace NzbDrone.Core.MediaFiles.Events if (downloadClientItem != null) { - DownloadClient = downloadClientItem.DownloadClient; + DownloadClient = downloadClientItem.DownloadClientInfo.Name; DownloadId = downloadClientItem.DownloadId; } } diff --git a/src/NzbDrone.Core/MediaFiles/Events/TrackImportedEvent.cs b/src/NzbDrone.Core/MediaFiles/Events/TrackImportedEvent.cs index 7139fd7fd..845788685 100644 --- a/src/NzbDrone.Core/MediaFiles/Events/TrackImportedEvent.cs +++ b/src/NzbDrone.Core/MediaFiles/Events/TrackImportedEvent.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.MediaFiles.Events if (downloadClientItem != null) { - DownloadClient = downloadClientItem.DownloadClient; + DownloadClient = downloadClientItem.DownloadClientInfo.Name; DownloadId = downloadClientItem.DownloadId; } } diff --git a/src/NzbDrone.Core/Queue/QueueService.cs b/src/NzbDrone.Core/Queue/QueueService.cs index 9783c0fc0..57efa912d 100644 --- a/src/NzbDrone.Core/Queue/QueueService.cs +++ b/src/NzbDrone.Core/Queue/QueueService.cs @@ -86,7 +86,7 @@ namespace NzbDrone.Core.Queue RemoteAlbum = trackedDownload.RemoteAlbum, DownloadId = trackedDownload.DownloadItem.DownloadId, Protocol = trackedDownload.Protocol, - DownloadClient = trackedDownload.DownloadItem.DownloadClient, + DownloadClient = trackedDownload.DownloadItem.DownloadClientInfo.Name, Indexer = trackedDownload.Indexer, OutputPath = trackedDownload.DownloadItem.OutputPath.ToString(), DownloadForced = downloadForced