mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-03 13:34:54 +00:00
New: Make monitoring existing albums on an import list optional
(cherry picked from commit b05bd685bc1bbd04d4b25b83a9fdd4ab3c4651ee)
This commit is contained in:
parent
92e0a6e6c6
commit
70ae0c931e
6 changed files with 43 additions and 4 deletions
|
@ -75,6 +75,7 @@ function EditImportListModalContent(props) {
|
|||
name,
|
||||
enableAutomaticAdd,
|
||||
shouldMonitor,
|
||||
shouldMonitorExisting,
|
||||
shouldSearch,
|
||||
rootFolderPath,
|
||||
monitorNewItems,
|
||||
|
@ -173,12 +174,28 @@ function EditImportListModalContent(props) {
|
|||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>Search for New Items</FormLabel>
|
||||
<FormLabel>
|
||||
{translate('ShouldMonitorExisting')}
|
||||
</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="shouldMonitorExisting"
|
||||
helpText={translate('ShouldMonitorExistingHelpText')}
|
||||
{...shouldMonitorExisting}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>
|
||||
{translate('ShouldSearch')}
|
||||
</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="shouldSearch"
|
||||
helpText={'Search indexers for newly added items. Use with caution for large lists.'}
|
||||
helpText={translate('ShouldSearchHelpText')}
|
||||
{...shouldSearch}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
|
|
|
@ -7,6 +7,7 @@ public class ImportListResource : ProviderResource<ImportListResource>
|
|||
{
|
||||
public bool EnableAutomaticAdd { get; set; }
|
||||
public ImportListMonitorType ShouldMonitor { get; set; }
|
||||
public bool ShouldMonitorExisting { get; set; }
|
||||
public bool ShouldSearch { get; set; }
|
||||
public string RootFolderPath { get; set; }
|
||||
public NewItemMonitorTypes MonitorNewItems { get; set; }
|
||||
|
@ -29,6 +30,7 @@ public override ImportListResource ToResource(ImportListDefinition definition)
|
|||
|
||||
resource.EnableAutomaticAdd = definition.EnableAutomaticAdd;
|
||||
resource.ShouldMonitor = definition.ShouldMonitor;
|
||||
resource.ShouldMonitorExisting = definition.ShouldMonitorExisting;
|
||||
resource.ShouldSearch = definition.ShouldSearch;
|
||||
resource.RootFolderPath = definition.RootFolderPath;
|
||||
resource.MonitorNewItems = definition.MonitorNewItems;
|
||||
|
@ -51,6 +53,7 @@ public override ImportListDefinition ToModel(ImportListResource resource)
|
|||
|
||||
definition.EnableAutomaticAdd = resource.EnableAutomaticAdd;
|
||||
definition.ShouldMonitor = resource.ShouldMonitor;
|
||||
definition.ShouldMonitorExisting = resource.ShouldMonitorExisting;
|
||||
definition.ShouldSearch = resource.ShouldSearch;
|
||||
definition.RootFolderPath = resource.RootFolderPath;
|
||||
definition.MonitorNewItems = resource.MonitorNewItems;
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(58)]
|
||||
public class ImportListMonitorExisting : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("ImportLists").AddColumn("ShouldMonitorExisting").AsInt32().WithDefaultValue(0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ public class ImportListDefinition : ProviderDefinition
|
|||
{
|
||||
public bool EnableAutomaticAdd { get; set; }
|
||||
public ImportListMonitorType ShouldMonitor { get; set; }
|
||||
public bool ShouldMonitorExisting { get; set; }
|
||||
public NewItemMonitorTypes MonitorNewItems { get; set; }
|
||||
public bool ShouldSearch { get; set; }
|
||||
public int ProfileId { get; set; }
|
||||
|
|
|
@ -184,7 +184,7 @@ private void ProcessAlbumReport(ImportListDefinition importList, ImportListItemI
|
|||
{
|
||||
_logger.Debug("{0} [{1}] Rejected, Album Exists in DB. Ensuring Album and Artist monitored.", report.AlbumMusicBrainzId, report.Album);
|
||||
|
||||
if (importList.ShouldMonitor != ImportListMonitorType.None)
|
||||
if (importList.ShouldMonitorExisting && importList.ShouldMonitor != ImportListMonitorType.None)
|
||||
{
|
||||
if (!existingAlbum.Monitored)
|
||||
{
|
||||
|
@ -288,7 +288,7 @@ private Artist ProcessArtistReport(ImportListDefinition importList, ImportListIt
|
|||
{
|
||||
_logger.Debug("{0} [{1}] Rejected, artist exists in DB. Ensuring artist monitored", report.ArtistMusicBrainzId, report.Artist);
|
||||
|
||||
if (!existingArtist.Monitored)
|
||||
if (importList.ShouldMonitorExisting && !existingArtist.Monitored)
|
||||
{
|
||||
existingArtist.Monitored = true;
|
||||
_artistService.UpdateArtist(existingArtist);
|
||||
|
|
|
@ -551,6 +551,10 @@
|
|||
"Settings": "Settings",
|
||||
"ShortDateFormat": "Short Date Format",
|
||||
"ShouldMonitorHelpText": "Monitor artists and albums added from this list",
|
||||
"ShouldMonitorExisting": "Monitor existing albums",
|
||||
"ShouldMonitorExistingHelpText": "Automatically monitor albums on this list which are already in Lidarr",
|
||||
"ShouldSearch": "Search for New Items",
|
||||
"ShouldSearchHelpText": "Search indexers for newly added items. Use with caution for large lists.",
|
||||
"ShowAlbumCount": "Show Album Count",
|
||||
"ShowBanners": "Show Banners",
|
||||
"ShowBannersHelpText": "Show banners instead of names",
|
||||
|
|
Loading…
Reference in a new issue