diff --git a/src/NzbDrone.Integration.Test/ApiTests/BlocklistFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/BlocklistFixture.cs index bfdd32942..c562a4b60 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/BlocklistFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/BlocklistFixture.cs @@ -1,6 +1,7 @@ using FluentAssertions; using NUnit.Framework; -using NzbDrone.Api.Series; +using Sonarr.Api.V3.Blocklist; +using Sonarr.Api.V3.Series; namespace NzbDrone.Integration.Test.ApiTests { @@ -15,7 +16,7 @@ namespace NzbDrone.Integration.Test.ApiTests { _series = EnsureSeries(266189, "The Blacklist"); - Blocklist.Post(new Api.Blocklist.BlocklistResource + Blocklist.Post(new BlocklistResource { SeriesId = _series.Id, SourceTitle = "Blacklist.S01E01.Brought.To.You.By-BoomBoxHD" diff --git a/src/NzbDrone.Integration.Test/ApiTests/CalendarFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/CalendarFixture.cs index fdc5c194f..bc05c025d 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/CalendarFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/CalendarFixture.cs @@ -1,6 +1,6 @@ using FluentAssertions; using NUnit.Framework; -using NzbDrone.Api.Episodes; +using Sonarr.Api.V3.Episodes; using NzbDrone.Integration.Test.Client; using System; using System.Collections.Generic; diff --git a/src/NzbDrone.Integration.Test/ApiTests/CommandFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/CommandFixture.cs index bf17b6d12..64ed9085d 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/CommandFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/CommandFixture.cs @@ -1,6 +1,6 @@ using FluentAssertions; using NUnit.Framework; -using NzbDrone.Api.Commands; +using Sonarr.Api.V3.Commands; namespace NzbDrone.Integration.Test.ApiTests { diff --git a/src/NzbDrone.Integration.Test/ApiTests/DiskSpaceFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/DiskSpaceFixture.cs index 527f18346..a16a2100f 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/DiskSpaceFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/DiskSpaceFixture.cs @@ -1,7 +1,7 @@ using System.Linq; using FluentAssertions; using NUnit.Framework; -using NzbDrone.Api.DiskSpace; +using Sonarr.Api.V3.DiskSpace; using NzbDrone.Integration.Test.Client; namespace NzbDrone.Integration.Test.ApiTests diff --git a/src/NzbDrone.Integration.Test/ApiTests/EpisodeFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/EpisodeFixture.cs index 636ce00ed..c4d8c1780 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/EpisodeFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/EpisodeFixture.cs @@ -1,7 +1,7 @@ using System.Threading; using FluentAssertions; using NUnit.Framework; -using NzbDrone.Api.Series; +using Sonarr.Api.V3.Series; using System.Linq; using NzbDrone.Test.Common; @@ -22,7 +22,7 @@ namespace NzbDrone.Integration.Test.ApiTests { var newSeries = Series.Lookup("archer").Single(c => c.TvdbId == 110381); - newSeries.ProfileId = 1; + newSeries.QualityProfileId = 1; newSeries.LanguageProfileId = 1; newSeries.Path = @"C:\Test\Archer".AsOsAgnostic(); diff --git a/src/NzbDrone.Integration.Test/ApiTests/IndexerFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/IndexerFixture.cs index 64ca5dd28..1fd4b30ae 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/IndexerFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/IndexerFixture.cs @@ -2,7 +2,7 @@ using FluentAssertions; using Newtonsoft.Json.Linq; using NUnit.Framework; -using NzbDrone.Api.Indexers; +using Sonarr.Api.V3.Indexers; using NzbDrone.Core.ThingiProvider; using Sonarr.Http.ClientSchema; @@ -28,7 +28,8 @@ namespace NzbDrone.Integration.Test.ApiTests schema.Name = name; schema.EnableRss = false; - schema.EnableSearch = false; + schema.EnableAutomaticSearch = false; + schema.EnableInteractiveSearch = false; return schema; } @@ -39,7 +40,8 @@ namespace NzbDrone.Integration.Test.ApiTests schema.Name = name; schema.EnableRss = false; - schema.EnableSearch = false; + schema.EnableAutomaticSearch = false; + schema.EnableInteractiveSearch = false; return schema; } diff --git a/src/NzbDrone.Integration.Test/ApiTests/ReleaseFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/ReleaseFixture.cs index d915b6ca3..fdcbe3dd6 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/ReleaseFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/ReleaseFixture.cs @@ -1,6 +1,6 @@ using FluentAssertions; using NUnit.Framework; -using NzbDrone.Api.Indexers; +using Sonarr.Api.V3.Indexers; using System.Linq; using System.Net; diff --git a/src/NzbDrone.Integration.Test/ApiTests/ReleasePushFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/ReleasePushFixture.cs index 2aa43dc08..07fc52a00 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/ReleasePushFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/ReleasePushFixture.cs @@ -1,6 +1,6 @@ using FluentAssertions; using NUnit.Framework; -using NzbDrone.Api.Indexers; +using Sonarr.Api.V3.Indexers; using System.Net; using System.Collections.Generic; using System; diff --git a/src/NzbDrone.Integration.Test/ApiTests/RootFolderFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/RootFolderFixture.cs index 5133a5da7..7376c1a6a 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/RootFolderFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/RootFolderFixture.cs @@ -1,7 +1,7 @@ using System; using FluentAssertions; using NUnit.Framework; -using NzbDrone.Api.RootFolders; +using Sonarr.Api.V3.RootFolders; namespace NzbDrone.Integration.Test.ApiTests { diff --git a/src/NzbDrone.Integration.Test/ApiTests/SeriesEditorFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/SeriesEditorFixture.cs index 046da4fbf..737fbb5da 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/SeriesEditorFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/SeriesEditorFixture.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Integration.Test.ApiTests { var newSeries = Series.Lookup(title).First(); - newSeries.ProfileId = 1; + newSeries.QualityProfileId = 1; newSeries.LanguageProfileId = 1; newSeries.Path = string.Format(@"C:\Test\{0}", title).AsOsAgnostic(); @@ -31,13 +31,13 @@ namespace NzbDrone.Integration.Test.ApiTests foreach (var s in series) { - s.ProfileId = 2; + s.QualityProfileId = 2; } var result = Series.Editor(series); result.Should().HaveCount(2); - result.TrueForAll(s => s.ProfileId == 2).Should().BeTrue(); + result.TrueForAll(s => s.QualityProfileId == 2).Should().BeTrue(); } } } \ No newline at end of file diff --git a/src/NzbDrone.Integration.Test/ApiTests/SeriesFixture.cs b/src/NzbDrone.Integration.Test/ApiTests/SeriesFixture.cs index fe7f2cd25..9a67e3a11 100644 --- a/src/NzbDrone.Integration.Test/ApiTests/SeriesFixture.cs +++ b/src/NzbDrone.Integration.Test/ApiTests/SeriesFixture.cs @@ -17,7 +17,7 @@ namespace NzbDrone.Integration.Test.ApiTests var series = Series.Lookup("tvdb:266189").Single(); - series.ProfileId = 1; + series.QualityProfileId = 1; series.LanguageProfileId = 1; series.Path = Path.Combine(SeriesRootFolder, series.Title); series.Tags = new HashSet(); @@ -48,7 +48,7 @@ namespace NzbDrone.Integration.Test.ApiTests var series = Series.Lookup("tvdb:266189").Single(); - series.ProfileId = 1; + series.QualityProfileId = 1; Series.InvalidPost(series); } @@ -60,7 +60,7 @@ namespace NzbDrone.Integration.Test.ApiTests var series = Series.Lookup("tvdb:266189").Single(); - series.ProfileId = 1; + series.QualityProfileId = 1; series.LanguageProfileId = 1; series.Path = Path.Combine(SeriesRootFolder, series.Title); @@ -68,7 +68,7 @@ namespace NzbDrone.Integration.Test.ApiTests result.Should().NotBeNull(); result.Id.Should().NotBe(0); - result.ProfileId.Should().Be(1); + result.QualityProfileId.Should().Be(1); result.LanguageProfileId.Should().Be(1); result.Path.Should().Be(Path.Combine(SeriesRootFolder, series.Title)); } @@ -107,16 +107,16 @@ namespace NzbDrone.Integration.Test.ApiTests var series = EnsureSeries(266189, "The Blacklist"); var profileId = 1; - if (series.ProfileId == profileId) + if (series.QualityProfileId == profileId) { profileId = 2; } - series.ProfileId = profileId; + series.QualityProfileId = profileId; var result = Series.Put(series); - Series.Get(series.Id).ProfileId.Should().Be(profileId); + Series.Get(series.Id).QualityProfileId.Should().Be(profileId); } [Test, Order(3)] diff --git a/src/NzbDrone.Integration.Test/Client/ClientBase.cs b/src/NzbDrone.Integration.Test/Client/ClientBase.cs index a5096e3f0..c0baa1b2c 100644 --- a/src/NzbDrone.Integration.Test/Client/ClientBase.cs +++ b/src/NzbDrone.Integration.Test/Client/ClientBase.cs @@ -2,7 +2,6 @@ using System.Net; using FluentAssertions; using NLog; -using NzbDrone.Api; using Sonarr.Http.REST; using NzbDrone.Common.Serializer; using RestSharp; diff --git a/src/NzbDrone.Integration.Test/Client/CommandClient.cs b/src/NzbDrone.Integration.Test/Client/CommandClient.cs index 047427a98..c35e92eb8 100644 --- a/src/NzbDrone.Integration.Test/Client/CommandClient.cs +++ b/src/NzbDrone.Integration.Test/Client/CommandClient.cs @@ -1,4 +1,4 @@ -using NzbDrone.Api.Commands; +using Sonarr.Api.V3.Commands; using RestSharp; using NzbDrone.Core.Messaging.Commands; using FluentAssertions; diff --git a/src/NzbDrone.Integration.Test/Client/DownloadClientClient.cs b/src/NzbDrone.Integration.Test/Client/DownloadClientClient.cs index e31e38748..9ed93ceef 100644 --- a/src/NzbDrone.Integration.Test/Client/DownloadClientClient.cs +++ b/src/NzbDrone.Integration.Test/Client/DownloadClientClient.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using NzbDrone.Api.DownloadClient; +using Sonarr.Api.V3.DownloadClient; using RestSharp; namespace NzbDrone.Integration.Test.Client diff --git a/src/NzbDrone.Integration.Test/Client/EpisodeClient.cs b/src/NzbDrone.Integration.Test/Client/EpisodeClient.cs index 46d0b8e03..a015b0758 100644 --- a/src/NzbDrone.Integration.Test/Client/EpisodeClient.cs +++ b/src/NzbDrone.Integration.Test/Client/EpisodeClient.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using NzbDrone.Api.Episodes; +using Sonarr.Api.V3.Episodes; using RestSharp; namespace NzbDrone.Integration.Test.Client diff --git a/src/NzbDrone.Integration.Test/Client/IndexerClient.cs b/src/NzbDrone.Integration.Test/Client/IndexerClient.cs index 6aaf5bbf7..a627db763 100644 --- a/src/NzbDrone.Integration.Test/Client/IndexerClient.cs +++ b/src/NzbDrone.Integration.Test/Client/IndexerClient.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using NzbDrone.Api.Indexers; +using Sonarr.Api.V3.Indexers; using RestSharp; namespace NzbDrone.Integration.Test.Client diff --git a/src/NzbDrone.Integration.Test/Client/NotificationClient.cs b/src/NzbDrone.Integration.Test/Client/NotificationClient.cs index 6f0f06eb5..f97a7b48a 100644 --- a/src/NzbDrone.Integration.Test/Client/NotificationClient.cs +++ b/src/NzbDrone.Integration.Test/Client/NotificationClient.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using NzbDrone.Api.Notifications; +using Sonarr.Api.V3.Notifications; using RestSharp; namespace NzbDrone.Integration.Test.Client diff --git a/src/NzbDrone.Integration.Test/Client/ReleaseClient.cs b/src/NzbDrone.Integration.Test/Client/ReleaseClient.cs index 46a6db839..2675953b6 100644 --- a/src/NzbDrone.Integration.Test/Client/ReleaseClient.cs +++ b/src/NzbDrone.Integration.Test/Client/ReleaseClient.cs @@ -1,4 +1,4 @@ -using NzbDrone.Api.Indexers; +using Sonarr.Api.V3.Indexers; using RestSharp; namespace NzbDrone.Integration.Test.Client diff --git a/src/NzbDrone.Integration.Test/Client/ReleasePushClient.cs b/src/NzbDrone.Integration.Test/Client/ReleasePushClient.cs index 9ea6ccce9..5245a5d3f 100644 --- a/src/NzbDrone.Integration.Test/Client/ReleasePushClient.cs +++ b/src/NzbDrone.Integration.Test/Client/ReleasePushClient.cs @@ -1,4 +1,4 @@ -using NzbDrone.Api.Indexers; +using Sonarr.Api.V3.Indexers; using RestSharp; namespace NzbDrone.Integration.Test.Client diff --git a/src/NzbDrone.Integration.Test/Client/SeriesClient.cs b/src/NzbDrone.Integration.Test/Client/SeriesClient.cs index 342fca2ec..53355253f 100644 --- a/src/NzbDrone.Integration.Test/Client/SeriesClient.cs +++ b/src/NzbDrone.Integration.Test/Client/SeriesClient.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Net; -using NzbDrone.Api.Series; +using Sonarr.Api.V3.Series; using RestSharp; namespace NzbDrone.Integration.Test.Client diff --git a/src/NzbDrone.Integration.Test/HttpLogFixture.cs b/src/NzbDrone.Integration.Test/HttpLogFixture.cs index 3b4ee7a88..4bf3f8166 100644 --- a/src/NzbDrone.Integration.Test/HttpLogFixture.cs +++ b/src/NzbDrone.Integration.Test/HttpLogFixture.cs @@ -2,6 +2,7 @@ using System; using System.Linq; using FluentAssertions; using NUnit.Framework; +using Sonarr.Api.V3.Series; namespace NzbDrone.Integration.Test { @@ -20,7 +21,7 @@ namespace NzbDrone.Integration.Test var logFile = "sonarr.trace.txt"; var logLines = Logs.GetLogFileLines(logFile); - var resultPost = Series.InvalidPost(new Api.Series.SeriesResource()); + var resultPost = Series.InvalidPost(new SeriesResource()); // Skip 2 and 1 to ignore the logs endpoint logLines = Logs.GetLogFileLines(logFile).Skip(logLines.Length + 2).ToArray(); diff --git a/src/NzbDrone.Integration.Test/IntegrationTest.cs b/src/NzbDrone.Integration.Test/IntegrationTest.cs index 876d2eacf..625f0896e 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTest.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTest.cs @@ -1,6 +1,7 @@ using NLog; using NzbDrone.Core.Indexers.Newznab; using NzbDrone.Test.Common; +using Sonarr.Api.V3.Indexers; using Sonarr.Http.ClientSchema; namespace NzbDrone.Integration.Test @@ -25,10 +26,11 @@ namespace NzbDrone.Integration.Test protected override void InitializeTestTarget() { - Indexers.Post(new Api.Indexers.IndexerResource + Indexers.Post(new IndexerResource { EnableRss = false, - EnableSearch = false, + EnableAutomaticSearch = false, + EnableInteractiveSearch = false, ConfigContract = nameof(NewznabSettings), Implementation = nameof(Newznab), Name = "NewznabTest", diff --git a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs index 848ddbea1..7b82e82e1 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTestBase.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTestBase.cs @@ -11,17 +11,17 @@ using NLog; using NLog.Config; using NLog.Targets; using NUnit.Framework; -using NzbDrone.Api.Blocklist; -using NzbDrone.Api.Commands; -using NzbDrone.Api.Config; -using NzbDrone.Api.DownloadClient; -using NzbDrone.Api.EpisodeFiles; -using NzbDrone.Api.Episodes; -using NzbDrone.Api.History; -using NzbDrone.Api.Profiles; -using NzbDrone.Api.RootFolders; -using NzbDrone.Api.Series; -using NzbDrone.Api.Tags; +using Sonarr.Api.V3.Blocklist; +using Sonarr.Api.V3.Commands; +using Sonarr.Api.V3.Config; +using Sonarr.Api.V3.DownloadClient; +using Sonarr.Api.V3.EpisodeFiles; +using Sonarr.Api.V3.Episodes; +using Sonarr.Api.V3.History; +using Sonarr.Api.V3.Profiles.Quality; +using Sonarr.Api.V3.RootFolders; +using Sonarr.Api.V3.Series; +using Sonarr.Api.V3.Tags; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.Serializer; using NzbDrone.Core.Qualities; @@ -50,7 +50,7 @@ namespace NzbDrone.Integration.Test public LogsClient Logs; public ClientBase NamingConfig; public NotificationClient Notifications; - public ClientBase Profiles; + public ClientBase Profiles; public ReleaseClient Releases; public ReleasePushClient ReleasePush; public ClientBase RootFolders; @@ -117,7 +117,7 @@ namespace NzbDrone.Integration.Test Logs = new LogsClient(RestClient, ApiKey); NamingConfig = new ClientBase(RestClient, ApiKey, "config/naming"); Notifications = new NotificationClient(RestClient, ApiKey); - Profiles = new ClientBase(RestClient, ApiKey); + Profiles = new ClientBase(RestClient, ApiKey); Releases = new ReleaseClient(RestClient, ApiKey); ReleasePush = new ReleasePushClient(RestClient, ApiKey); RootFolders = new ClientBase(RestClient, ApiKey); @@ -236,7 +236,7 @@ namespace NzbDrone.Integration.Test { var lookup = Series.Lookup("tvdb:" + tvdbId); var series = lookup.First(); - series.ProfileId = 1; + series.QualityProfileId = 1; series.LanguageProfileId = 1; series.Path = Path.Combine(SeriesRootFolder, series.Title); series.Monitored = true; @@ -308,14 +308,14 @@ namespace NzbDrone.Integration.Test return result.EpisodeFile; } - public ProfileResource EnsureProfileCutoff(int profileId, Quality cutoff, bool upgradeAllowed) + public QualityProfileResource EnsureProfileCutoff(int profileId, Quality cutoff, bool upgradeAllowed) { var needsUpdate = false; var profile = Profiles.Get(profileId); - if (profile.Cutoff != cutoff) + if (profile.Cutoff != cutoff.Id) { - profile.Cutoff = cutoff; + profile.Cutoff = cutoff.Id; needsUpdate = true; } diff --git a/src/NzbDrone.Integration.Test/Sonarr.Integration.Test.csproj b/src/NzbDrone.Integration.Test/Sonarr.Integration.Test.csproj index f09998d8e..8e8238b10 100644 --- a/src/NzbDrone.Integration.Test/Sonarr.Integration.Test.csproj +++ b/src/NzbDrone.Integration.Test/Sonarr.Integration.Test.csproj @@ -7,7 +7,8 @@ - + + diff --git a/src/Sonarr.Http/Extensions/Pipelines/RequestLoggingPipeline.cs b/src/Sonarr.Http/Extensions/Pipelines/RequestLoggingPipeline.cs index 3a16d1046..a1639c4fd 100644 --- a/src/Sonarr.Http/Extensions/Pipelines/RequestLoggingPipeline.cs +++ b/src/Sonarr.Http/Extensions/Pipelines/RequestLoggingPipeline.cs @@ -5,10 +5,8 @@ using Nancy.Bootstrapper; using NLog; using NzbDrone.Common.Extensions; using Sonarr.Http.ErrorManagement; -using Sonarr.Http.Extensions; -using Sonarr.Http.Extensions.Pipelines; -namespace NzbDrone.Api.Extensions.Pipelines +namespace Sonarr.Http.Extensions.Pipelines { public class RequestLoggingPipeline : IRegisterNancyPipeline {