diff --git a/src/Sonarr.Api.V3/DownloadClient/DownloadClientController.cs b/src/Sonarr.Api.V3/DownloadClient/DownloadClientController.cs index 48795c542..0f79a83c6 100644 --- a/src/Sonarr.Api.V3/DownloadClient/DownloadClientController.cs +++ b/src/Sonarr.Api.V3/DownloadClient/DownloadClientController.cs @@ -6,8 +6,8 @@ namespace Sonarr.Api.V3.DownloadClient [V3ApiController] public class DownloadClientController : ProviderControllerBase { - public static readonly DownloadClientResourceMapper ResourceMapper = new DownloadClientResourceMapper(); - public static readonly DownloadClientBulkResourceMapper BulkResourceMapper = new DownloadClientBulkResourceMapper(); + public static readonly DownloadClientResourceMapper ResourceMapper = new (); + public static readonly DownloadClientBulkResourceMapper BulkResourceMapper = new (); public DownloadClientController(IDownloadClientFactory downloadClientFactory) : base(downloadClientFactory, "downloadclient", ResourceMapper, BulkResourceMapper) diff --git a/src/Sonarr.Api.V3/ImportLists/ImportListController.cs b/src/Sonarr.Api.V3/ImportLists/ImportListController.cs index 659d54d9f..8ea3887dd 100644 --- a/src/Sonarr.Api.V3/ImportLists/ImportListController.cs +++ b/src/Sonarr.Api.V3/ImportLists/ImportListController.cs @@ -8,8 +8,8 @@ namespace Sonarr.Api.V3.ImportLists [V3ApiController] public class ImportListController : ProviderControllerBase { - public static readonly ImportListResourceMapper ResourceMapper = new ImportListResourceMapper(); - public static readonly ImportListBulkResourceMapper BulkResourceMapper = new ImportListBulkResourceMapper(); + public static readonly ImportListResourceMapper ResourceMapper = new (); + public static readonly ImportListBulkResourceMapper BulkResourceMapper = new (); public ImportListController(IImportListFactory importListFactory, ProfileExistsValidator profileExistsValidator) : base(importListFactory, "importlist", ResourceMapper, BulkResourceMapper) diff --git a/src/Sonarr.Api.V3/Indexers/IndexerController.cs b/src/Sonarr.Api.V3/Indexers/IndexerController.cs index 0f79678d1..444993c2f 100644 --- a/src/Sonarr.Api.V3/Indexers/IndexerController.cs +++ b/src/Sonarr.Api.V3/Indexers/IndexerController.cs @@ -6,8 +6,8 @@ namespace Sonarr.Api.V3.Indexers [V3ApiController] public class IndexerController : ProviderControllerBase { - public static readonly IndexerResourceMapper ResourceMapper = new IndexerResourceMapper(); - public static readonly IndexerBulkResourceMapper BulkResourceMapper = new IndexerBulkResourceMapper(); + public static readonly IndexerResourceMapper ResourceMapper = new (); + public static readonly IndexerBulkResourceMapper BulkResourceMapper = new (); public IndexerController(IndexerFactory indexerFactory) : base(indexerFactory, "indexer", ResourceMapper, BulkResourceMapper) diff --git a/src/Sonarr.Api.V3/Metadata/MetadataController.cs b/src/Sonarr.Api.V3/Metadata/MetadataController.cs index 1f27d1e31..006cab8ba 100644 --- a/src/Sonarr.Api.V3/Metadata/MetadataController.cs +++ b/src/Sonarr.Api.V3/Metadata/MetadataController.cs @@ -1,3 +1,5 @@ +using System; +using Microsoft.AspNetCore.Mvc; using NzbDrone.Core.Extras.Metadata; using Sonarr.Http; @@ -6,12 +8,24 @@ namespace Sonarr.Api.V3.Metadata [V3ApiController] public class MetadataController : ProviderControllerBase { - public static readonly MetadataResourceMapper ResourceMapper = new MetadataResourceMapper(); - public static readonly MetadataBulkResourceMapper BulkResourceMapper = new MetadataBulkResourceMapper(); + public static readonly MetadataResourceMapper ResourceMapper = new (); + public static readonly MetadataBulkResourceMapper BulkResourceMapper = new (); public MetadataController(IMetadataFactory metadataFactory) : base(metadataFactory, "metadata", ResourceMapper, BulkResourceMapper) { } + + [NonAction] + public override ActionResult UpdateProvider([FromBody] MetadataBulkResource providerResource) + { + throw new NotImplementedException(); + } + + [NonAction] + public override object DeleteProviders([FromBody] MetadataBulkResource resource) + { + throw new NotImplementedException(); + } } } diff --git a/src/Sonarr.Api.V3/Notifications/NotificationController.cs b/src/Sonarr.Api.V3/Notifications/NotificationController.cs index 7e3566b01..b20c0fae7 100644 --- a/src/Sonarr.Api.V3/Notifications/NotificationController.cs +++ b/src/Sonarr.Api.V3/Notifications/NotificationController.cs @@ -1,3 +1,5 @@ +using System; +using Microsoft.AspNetCore.Mvc; using NzbDrone.Core.Notifications; using Sonarr.Http; @@ -6,12 +8,24 @@ namespace Sonarr.Api.V3.Notifications [V3ApiController] public class NotificationController : ProviderControllerBase { - public static readonly NotificationResourceMapper ResourceMapper = new NotificationResourceMapper(); - public static readonly NotificationBulkResourceMapper BulkResourceMapper = new NotificationBulkResourceMapper(); + public static readonly NotificationResourceMapper ResourceMapper = new (); + public static readonly NotificationBulkResourceMapper BulkResourceMapper = new (); public NotificationController(NotificationFactory notificationFactory) : base(notificationFactory, "notification", ResourceMapper, BulkResourceMapper) { } + + [NonAction] + public override ActionResult UpdateProvider([FromBody] NotificationBulkResource providerResource) + { + throw new NotImplementedException(); + } + + [NonAction] + public override object DeleteProviders([FromBody] NotificationBulkResource resource) + { + throw new NotImplementedException(); + } } } diff --git a/src/Sonarr.Api.V3/ProviderControllerBase.cs b/src/Sonarr.Api.V3/ProviderControllerBase.cs index dc14d7865..c5f6a5bcb 100644 --- a/src/Sonarr.Api.V3/ProviderControllerBase.cs +++ b/src/Sonarr.Api.V3/ProviderControllerBase.cs @@ -103,7 +103,7 @@ namespace Sonarr.Api.V3 [HttpPut("bulk")] [Consumes("application/json")] [Produces("application/json")] - public ActionResult UpdateProvider([FromBody] TBulkProviderResource providerResource) + public virtual ActionResult UpdateProvider([FromBody] TBulkProviderResource providerResource) { if (!providerResource.Ids.Any()) { @@ -164,7 +164,7 @@ namespace Sonarr.Api.V3 [HttpDelete("bulk")] [Consumes("application/json")] - public object DeleteProviders([FromBody] TBulkProviderResource resource) + public virtual object DeleteProviders([FromBody] TBulkProviderResource resource) { _providerFactory.Delete(resource.Ids);