New: Option to disable automatic search on import lists

This commit is contained in:
ta264
2020-08-19 22:44:06 +01:00
parent ede8b9aa4a
commit 9fc0a8d4d1
6 changed files with 42 additions and 3 deletions

View File

@@ -0,0 +1,14 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(2)]
public class ImportListSearch : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("ImportLists").AddColumn("ShouldSearch").AsInt32().WithDefaultValue(1);
}
}
}

View File

@@ -6,6 +6,7 @@ namespace NzbDrone.Core.ImportLists
{
public bool EnableAutomaticAdd { get; set; }
public ImportListMonitorType ShouldMonitor { get; set; }
public bool ShouldSearch { get; set; }
public int ProfileId { get; set; }
public int MetadataProfileId { get; set; }
public string RootFolderPath { get; set; }

View File

@@ -224,7 +224,7 @@ namespace NzbDrone.Core.ImportLists
Tags = importList.Tags,
AddOptions = new AddAuthorOptions
{
SearchForMissingBooks = monitored,
SearchForMissingBooks = importList.ShouldSearch,
Monitored = monitored,
Monitor = monitored ? MonitorTypes.All : MonitorTypes.None
}
@@ -292,7 +292,7 @@ namespace NzbDrone.Core.ImportLists
Tags = importList.Tags,
AddOptions = new AddAuthorOptions
{
SearchForMissingBooks = monitored,
SearchForMissingBooks = importList.ShouldSearch,
Monitored = monitored,
Monitor = monitored ? MonitorTypes.All : MonitorTypes.None
}

View File

@@ -6,6 +6,7 @@ namespace Readarr.Api.V1.ImportLists
{
public bool EnableAutomaticAdd { get; set; }
public ImportListMonitorType ShouldMonitor { get; set; }
public bool ShouldSearch { get; set; }
public string RootFolderPath { get; set; }
public int QualityProfileId { get; set; }
public int MetadataProfileId { get; set; }
@@ -26,6 +27,7 @@ namespace Readarr.Api.V1.ImportLists
resource.EnableAutomaticAdd = definition.EnableAutomaticAdd;
resource.ShouldMonitor = definition.ShouldMonitor;
resource.ShouldSearch = definition.ShouldSearch;
resource.RootFolderPath = definition.RootFolderPath;
resource.QualityProfileId = definition.ProfileId;
resource.MetadataProfileId = definition.MetadataProfileId;
@@ -46,6 +48,7 @@ namespace Readarr.Api.V1.ImportLists
definition.EnableAutomaticAdd = resource.EnableAutomaticAdd;
definition.ShouldMonitor = resource.ShouldMonitor;
definition.ShouldSearch = resource.ShouldSearch;
definition.RootFolderPath = resource.RootFolderPath;
definition.ProfileId = resource.QualityProfileId;
definition.MetadataProfileId = resource.MetadataProfileId;