New: Option to disable automatic search on import lists

pull/395/head
ta264 4 years ago
parent ede8b9aa4a
commit 9fc0a8d4d1

@ -71,6 +71,7 @@ function EditImportListModalContent(props) {
name,
enableAutomaticAdd,
shouldMonitor,
shouldSearch,
rootFolderPath,
qualityProfileId,
metadataProfileId,
@ -148,6 +149,18 @@ function EditImportListModalContent(props) {
/>
</FormGroup>
<FormGroup>
<FormLabel>Search for New Items</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="shouldSearch"
helpText={'Search indexers for newly added items. Use with caution for large lists.'}
{...shouldSearch}
onChange={onInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>Root Folder</FormLabel>

@ -54,7 +54,8 @@ class ImportList extends Component {
const {
id,
name,
enableAutomaticAdd
enableAutomaticAdd,
shouldSearch
} = this.props;
return (
@ -75,6 +76,12 @@ class ImportList extends Component {
</Label>
}
{
shouldSearch &&
<Label kind={kinds.SUCCESS}>
Automatic Search
</Label>
}
</div>
<EditImportListModalConnector
@ -102,6 +109,7 @@ ImportList.propTypes = {
id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
enableAutomaticAdd: PropTypes.bool.isRequired,
shouldSearch: PropTypes.bool.isRequired,
onConfirmDeleteImportList: PropTypes.func.isRequired
};

@ -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);
}
}
}

@ -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; }

@ -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
}

@ -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;

Loading…
Cancel
Save