New: Option to disable automatic search on import lists

(cherry picked from commit 9fc0a8d4d1109ee5a99e3776b4dcec6b3d458fbc)
pull/2877/head
ta264 2 years ago
parent 33bb5960e5
commit 92e0a6e6c6

@ -75,6 +75,7 @@ function EditImportListModalContent(props) {
name,
enableAutomaticAdd,
shouldMonitor,
shouldSearch,
rootFolderPath,
monitorNewItems,
qualityProfileId,
@ -170,6 +171,18 @@ function EditImportListModalContent(props) {
onChange={onInputChange}
/>
</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>
</FieldSet>
<FieldSet legend={translate('AddedArtistSettings')} >

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

@ -7,6 +7,7 @@ namespace Lidarr.Api.V1.ImportLists
{
public bool EnableAutomaticAdd { get; set; }
public ImportListMonitorType ShouldMonitor { get; set; }
public bool ShouldSearch { get; set; }
public string RootFolderPath { get; set; }
public NewItemMonitorTypes MonitorNewItems { get; set; }
public int QualityProfileId { get; set; }
@ -28,6 +29,7 @@ namespace Lidarr.Api.V1.ImportLists
resource.EnableAutomaticAdd = definition.EnableAutomaticAdd;
resource.ShouldMonitor = definition.ShouldMonitor;
resource.ShouldSearch = definition.ShouldSearch;
resource.RootFolderPath = definition.RootFolderPath;
resource.MonitorNewItems = definition.MonitorNewItems;
resource.QualityProfileId = definition.ProfileId;
@ -49,6 +51,7 @@ namespace Lidarr.Api.V1.ImportLists
definition.EnableAutomaticAdd = resource.EnableAutomaticAdd;
definition.ShouldMonitor = resource.ShouldMonitor;
definition.ShouldSearch = resource.ShouldSearch;
definition.RootFolderPath = resource.RootFolderPath;
definition.MonitorNewItems = resource.MonitorNewItems;
definition.ProfileId = resource.QualityProfileId;

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

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

@ -221,7 +221,7 @@ namespace NzbDrone.Core.ImportLists
Tags = importList.Tags,
AddOptions = new AddArtistOptions
{
SearchForMissingAlbums = monitored,
SearchForMissingAlbums = importList.ShouldSearch,
Monitored = monitored,
Monitor = monitored ? MonitorTypes.All : MonitorTypes.None
}
@ -240,7 +240,7 @@ namespace NzbDrone.Core.ImportLists
Artist = toAddArtist,
AddOptions = new AddAlbumOptions
{
SearchForNewAlbum = monitored
SearchForNewAlbum = importList.ShouldSearch
}
};
@ -321,7 +321,7 @@ namespace NzbDrone.Core.ImportLists
Tags = importList.Tags,
AddOptions = new AddArtistOptions
{
SearchForMissingAlbums = monitored,
SearchForMissingAlbums = importList.ShouldSearch,
Monitored = monitored,
Monitor = monitored ? MonitorTypes.All : MonitorTypes.None
}

Loading…
Cancel
Save