New: Series type and season folder options for import lists

Closes #3982
This commit is contained in:
Mark McDowall 2020-10-02 16:14:00 -07:00
parent f9e045d14c
commit 25baf7bb45
6 changed files with 73 additions and 8 deletions

View File

@ -1,5 +1,6 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import SeriesTypePopoverContent from 'AddSeries/SeriesTypePopoverContent';
import SeriesMonitoringOptionsPopoverContent from 'AddSeries/SeriesMonitoringOptionsPopoverContent'; import SeriesMonitoringOptionsPopoverContent from 'AddSeries/SeriesMonitoringOptionsPopoverContent';
import { icons, inputTypes, kinds, tooltipPositions } from 'Helpers/Props'; import { icons, inputTypes, kinds, tooltipPositions } from 'Helpers/Props';
import Icon from 'Components/Icon'; import Icon from 'Components/Icon';
@ -46,6 +47,8 @@ function EditImportListModalContent(props) {
rootFolderPath, rootFolderPath,
qualityProfileId, qualityProfileId,
languageProfileId, languageProfileId,
seriesType,
seasonFolder,
tags, tags,
fields fields
} = item; } = item;
@ -138,7 +141,7 @@ function EditImportListModalContent(props) {
<FormInputGroup <FormInputGroup
type={inputTypes.QUALITY_PROFILE_SELECT} type={inputTypes.QUALITY_PROFILE_SELECT}
name="qualityProfileId" name="qualityProfileId"
helpText={'Quality Profile list items should be added with'} helpText={'Quality Profile list items will be added with'}
{...qualityProfileId} {...qualityProfileId}
onChange={onInputChange} onChange={onInputChange}
/> />
@ -150,19 +153,55 @@ function EditImportListModalContent(props) {
<FormInputGroup <FormInputGroup
type={inputTypes.LANGUAGE_PROFILE_SELECT} type={inputTypes.LANGUAGE_PROFILE_SELECT}
name="languageProfileId" name="languageProfileId"
helpText={'Language Profile list items should be added with'} helpText={'Language Profile list items will be added with'}
{...languageProfileId} {...languageProfileId}
onChange={onInputChange} onChange={onInputChange}
/> />
</FormGroup> </FormGroup>
<FormGroup>
<FormLabel>
Series Type
<Popover
anchor={
<Icon
className={styles.labelIcon}
name={icons.INFO}
/>
}
title="Series Types"
body={<SeriesTypePopoverContent />}
position={tooltipPositions.RIGHT}
/>
</FormLabel>
<FormInputGroup
type={inputTypes.SERIES_TYPE_SELECT}
name="seriesType"
onChange={onInputChange}
{...seriesType}
/>
</FormGroup>
<FormGroup>
<FormLabel>Season Folder</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="seasonFolder"
onChange={onInputChange}
{...seasonFolder}
/>
</FormGroup>
<FormGroup> <FormGroup>
<FormLabel>Sonarr Tags</FormLabel> <FormLabel>Sonarr Tags</FormLabel>
<FormInputGroup <FormInputGroup
type={inputTypes.TAG} type={inputTypes.TAG}
name="tags" name="tags"
helpText="Add series from this list with these tags" helpText="Tags list items will be added with"
{...tags} {...tags}
onChange={onInputChange} onChange={onInputChange}
/> />

View File

@ -109,6 +109,8 @@ export default {
return selectProviderSchema(state, section, payload, (selectedSchema) => { return selectProviderSchema(state, section, payload, (selectedSchema) => {
selectedSchema.enableAutomaticAdd = true; selectedSchema.enableAutomaticAdd = true;
selectedSchema.shouldMonitor = 'all'; selectedSchema.shouldMonitor = 'all';
selectedSchema.seriesType = 'standard';
selectedSchema.seasonFolder = true;
return selectedSchema; return selectedSchema;
}); });

View File

@ -0,0 +1,15 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(144)]
public class import_lists_series_type_and_season_folder : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("ImportLists").AddColumn("SeriesType").AsInt32().WithDefaultValue(0);
Alter.Table("ImportLists").AddColumn("SeasonFolder").AsBoolean().WithDefaultValue(true);
}
}
}

View File

@ -9,6 +9,8 @@ namespace NzbDrone.Core.ImportLists
public MonitorTypes ShouldMonitor { get; set; } public MonitorTypes ShouldMonitor { get; set; }
public int QualityProfileId { get; set; } public int QualityProfileId { get; set; }
public int LanguageProfileId { get; set; } public int LanguageProfileId { get; set; }
public SeriesTypes SeriesType { get; set; }
public bool SeasonFolder { get; set; }
public string RootFolderPath { get; set; } public string RootFolderPath { get; set; }
public override bool Enable => EnableAutomaticAdd; public override bool Enable => EnableAutomaticAdd;

View File

@ -125,8 +125,9 @@ namespace NzbDrone.Core.ImportLists
RootFolderPath = importList.RootFolderPath, RootFolderPath = importList.RootFolderPath,
QualityProfileId = importList.QualityProfileId, QualityProfileId = importList.QualityProfileId,
LanguageProfileId = importList.LanguageProfileId, LanguageProfileId = importList.LanguageProfileId,
SeriesType = importList.SeriesType,
SeasonFolder = importList.SeasonFolder,
Tags = importList.Tags, Tags = importList.Tags,
SeasonFolder = true,
AddOptions = new AddSeriesOptions AddOptions = new AddSeriesOptions
{ {
SearchForMissingEpisodes = monitored, SearchForMissingEpisodes = monitored,

View File

@ -10,6 +10,8 @@ namespace Sonarr.Api.V3.ImportLists
public string RootFolderPath { get; set; } public string RootFolderPath { get; set; }
public int QualityProfileId { get; set; } public int QualityProfileId { get; set; }
public int LanguageProfileId { get; set; } public int LanguageProfileId { get; set; }
public SeriesTypes SeriesType { get; set; }
public bool SeasonFolder { get; set; }
public ImportListType ListType { get; set; } public ImportListType ListType { get; set; }
public int ListOrder { get; set; } public int ListOrder { get; set; }
} }
@ -30,6 +32,8 @@ namespace Sonarr.Api.V3.ImportLists
resource.RootFolderPath = definition.RootFolderPath; resource.RootFolderPath = definition.RootFolderPath;
resource.QualityProfileId = definition.QualityProfileId; resource.QualityProfileId = definition.QualityProfileId;
resource.LanguageProfileId = definition.LanguageProfileId; resource.LanguageProfileId = definition.LanguageProfileId;
resource.SeriesType = definition.SeriesType;
resource.SeasonFolder = definition.SeasonFolder;
resource.ListType = definition.ListType; resource.ListType = definition.ListType;
resource.ListOrder = (int) definition.ListType; resource.ListOrder = (int) definition.ListType;
@ -50,6 +54,8 @@ namespace Sonarr.Api.V3.ImportLists
definition.RootFolderPath = resource.RootFolderPath; definition.RootFolderPath = resource.RootFolderPath;
definition.QualityProfileId = resource.QualityProfileId; definition.QualityProfileId = resource.QualityProfileId;
definition.LanguageProfileId = resource.LanguageProfileId; definition.LanguageProfileId = resource.LanguageProfileId;
definition.SeriesType = resource.SeriesType;
definition.SeasonFolder = resource.SeasonFolder;
definition.ListType = resource.ListType; definition.ListType = resource.ListType;
return definition; return definition;