New: Make monitoring existing books on an import list optional

pull/1332/head
ta264 3 years ago
parent 33e5351add
commit b05bd685bc

@ -73,6 +73,7 @@ function EditImportListModalContent(props) {
name, name,
enableAutomaticAdd, enableAutomaticAdd,
shouldMonitor, shouldMonitor,
shouldMonitorExisting,
shouldSearch, shouldSearch,
rootFolderPath, rootFolderPath,
qualityProfileId, qualityProfileId,
@ -167,6 +168,20 @@ function EditImportListModalContent(props) {
/> />
</FormGroup> </FormGroup>
<FormGroup>
<FormLabel>
{translate('ShouldMonitorExisting')}
</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="shouldMonitorExisting"
helpText={translate('ShouldMonitorExistingHelpText')}
{...shouldMonitorExisting}
onChange={onInputChange}
/>
</FormGroup>
<FormGroup> <FormGroup>
<FormLabel> <FormLabel>
{translate('SearchForNewItems')} {translate('SearchForNewItems')}

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

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

@ -196,7 +196,7 @@ namespace NzbDrone.Core.ImportLists
{ {
_logger.Debug("{0} [{1}] Rejected, Book Exists in DB. Ensuring Book and Author monitored.", report.EditionGoodreadsId, report.Book); _logger.Debug("{0} [{1}] Rejected, Book Exists in DB. Ensuring Book and Author monitored.", report.EditionGoodreadsId, report.Book);
if (importList.ShouldMonitor != ImportListMonitorType.None) if (importList.ShouldMonitorExisting && importList.ShouldMonitor != ImportListMonitorType.None)
{ {
if (!existingBook.Monitored) if (!existingBook.Monitored)
{ {
@ -307,7 +307,7 @@ namespace NzbDrone.Core.ImportLists
{ {
_logger.Debug("{0} [{1}] Rejected, Author Exists in DB. Ensuring Author monitored", report.AuthorGoodreadsId, report.Author); _logger.Debug("{0} [{1}] Rejected, Author Exists in DB. Ensuring Author monitored", report.AuthorGoodreadsId, report.Author);
if (!existingAuthor.Monitored) if (importList.ShouldMonitorExisting && !existingAuthor.Monitored)
{ {
existingAuthor.Monitored = true; existingAuthor.Monitored = true;
_authorService.UpdateAuthor(existingAuthor); _authorService.UpdateAuthor(existingAuthor);

@ -569,7 +569,9 @@
"SetPermissionsLinuxHelpTextWarning": "If you're unsure what these settings do, do not alter them.", "SetPermissionsLinuxHelpTextWarning": "If you're unsure what these settings do, do not alter them.",
"Settings": "Settings", "Settings": "Settings",
"ShortDateFormat": "Short Date Format", "ShortDateFormat": "Short Date Format",
"ShouldMonitorHelpText": "Monitor authors and books added from this list", "ShouldMonitorHelpText": "Monitor new authors and books added from this list",
"ShouldMonitorExisting": "Monitor existing books",
"ShouldMonitorExistingHelpText": "Automatically monitor books on this list which are already in Readarr",
"ShouldSearchHelpText": "Search indexers for newly added items. Use with caution for large lists.", "ShouldSearchHelpText": "Search indexers for newly added items. Use with caution for large lists.",
"ShowBanners": "Show Banners", "ShowBanners": "Show Banners",
"ShowBannersHelpText": "Show banners instead of names", "ShowBannersHelpText": "Show banners instead of names",

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

Loading…
Cancel
Save