Fixed: Mass disable/enable indexers

pull/26/head
ta264 4 years ago
parent 76bded0c50
commit 7fa4b322eb

@ -1,10 +1,10 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;
using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Commands;
using Prowlarr.Http; using Prowlarr.Http;
using Prowlarr.Http.Extensions;
namespace Prowlarr.Api.V1.Indexers namespace Prowlarr.Api.V1.Indexers
{ {
@ -29,9 +29,9 @@ namespace Prowlarr.Api.V1.Indexers
foreach (var indexer in indexersToUpdate) foreach (var indexer in indexersToUpdate)
{ {
if (resource.Enable.HasValue) if (resource.Enable.IsNotNullOrWhiteSpace())
{ {
indexer.Enable = resource.Enable.Value; indexer.Enable = bool.Parse(resource.Enable);
} }
if (resource.Tags != null) if (resource.Tags != null)

@ -5,7 +5,7 @@ namespace Prowlarr.Api.V1.Indexers
public class IndexerEditorResource public class IndexerEditorResource
{ {
public List<int> IndexerIds { get; set; } public List<int> IndexerIds { get; set; }
public bool? Enable { get; set; } public string Enable { get; set; }
public List<int> Tags { get; set; } public List<int> Tags { get; set; }
public ApplyTags ApplyTags { get; set; } public ApplyTags ApplyTags { get; set; }
} }

Loading…
Cancel
Save