mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-08 13:01:10 +02:00
Refactored from retroApplyTags to TagExisting
This commit is contained in:
parent
ce4a875398
commit
68e666137f
13 changed files with 37 additions and 37 deletions
|
|
@ -80,7 +80,7 @@ function EditImportListModalContent({
|
|||
qualityProfileId,
|
||||
seriesType,
|
||||
seasonFolder,
|
||||
retroApplyTags,
|
||||
tagExisting,
|
||||
tags,
|
||||
fields,
|
||||
} = item;
|
||||
|
|
@ -295,13 +295,13 @@ function EditImportListModalContent({
|
|||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>{translate('RetroApplyTags')}</FormLabel>
|
||||
<FormLabel>{translate('TagExisting')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.CHECK}
|
||||
name="retroApplyTags"
|
||||
helpText={translate('RetroApplyListTagsHelpText')}
|
||||
{...retroApplyTags}
|
||||
name="tagExisting"
|
||||
helpText={translate('TagExistingHelpText')}
|
||||
{...tagExisting}
|
||||
onChange={handleInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ interface SavePayload {
|
|||
enableAutomaticAdd?: boolean;
|
||||
qualityProfileId?: number;
|
||||
rootFolderPath?: string;
|
||||
retroApplyTags?: boolean;
|
||||
tagExisting?: boolean;
|
||||
}
|
||||
|
||||
interface ManageImportListsEditModalContentProps {
|
||||
|
|
@ -60,7 +60,7 @@ function ManageImportListsEditModalContent(
|
|||
NO_CHANGE
|
||||
);
|
||||
const [rootFolderPath, setRootFolderPath] = useState(NO_CHANGE);
|
||||
const [retroApplyTags, setRetroApplyTags] = useState(NO_CHANGE);
|
||||
const [tagExisting, setTagExisting] = useState(NO_CHANGE);
|
||||
|
||||
const save = useCallback(() => {
|
||||
let hasChanges = false;
|
||||
|
|
@ -80,9 +80,9 @@ function ManageImportListsEditModalContent(
|
|||
hasChanges = true;
|
||||
payload.rootFolderPath = rootFolderPath;
|
||||
}
|
||||
if (retroApplyTags !== NO_CHANGE) {
|
||||
if (tagExisting !== NO_CHANGE) {
|
||||
hasChanges = true;
|
||||
payload.retroApplyTags = retroApplyTags === 'enabled';
|
||||
payload.tagExisting = tagExisting === 'enabled';
|
||||
}
|
||||
|
||||
if (hasChanges) {
|
||||
|
|
@ -94,7 +94,7 @@ function ManageImportListsEditModalContent(
|
|||
enableAutomaticAdd,
|
||||
qualityProfileId,
|
||||
rootFolderPath,
|
||||
retroApplyTags,
|
||||
tagExisting,
|
||||
onSavePress,
|
||||
onModalClose,
|
||||
]);
|
||||
|
|
@ -110,8 +110,8 @@ function ManageImportListsEditModalContent(
|
|||
case 'rootFolderPath':
|
||||
setRootFolderPath(value as string);
|
||||
break;
|
||||
case 'retroApplyTags':
|
||||
setRetroApplyTags(value as string);
|
||||
case 'tagExisting':
|
||||
setTagExisting(value as string);
|
||||
break;
|
||||
default:
|
||||
console.warn(`EditImportListModalContent Unknown Input: '${name}'`);
|
||||
|
|
@ -165,12 +165,12 @@ function ManageImportListsEditModalContent(
|
|||
</FormGroup>
|
||||
|
||||
<FormGroup>
|
||||
<FormLabel>{translate('RetroApplyTags')}</FormLabel>
|
||||
<FormLabel>{translate('TagExisting')}</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.SELECT}
|
||||
name="retroApplyTags"
|
||||
value={retroApplyTags}
|
||||
name="tagExisting"
|
||||
value={tagExisting}
|
||||
values={autoAddOptions}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ const COLUMNS = [
|
|||
isVisible: true,
|
||||
},
|
||||
{
|
||||
name: 'retroApplyTags',
|
||||
label: () => translate('RetroApplyTags'),
|
||||
name: 'tagExisting',
|
||||
label: () => translate('TagExisting'),
|
||||
isSortable: true,
|
||||
isVisible: true,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
.enableAutomaticAdd,
|
||||
.qualityProfileId,
|
||||
.rootFolderPath,
|
||||
.retroApply,
|
||||
.tagExisting,
|
||||
.implementation {
|
||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ interface CssExports {
|
|||
'implementation': string;
|
||||
'name': string;
|
||||
'qualityProfileId': string;
|
||||
'retroApply': string;
|
||||
'rootFolderPath': string;
|
||||
'tagExisting': string;
|
||||
'tags': string;
|
||||
}
|
||||
export const cssExports: CssExports;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ interface ManageImportListsModalRowProps {
|
|||
qualityProfileId: number;
|
||||
implementation: string;
|
||||
tags: number[];
|
||||
retroApplyTags: boolean;
|
||||
tagExisting: boolean;
|
||||
enableAutomaticAdd: boolean;
|
||||
columns: Column[];
|
||||
}
|
||||
|
|
@ -32,7 +32,7 @@ function ManageImportListsModalRow(props: ManageImportListsModalRowProps) {
|
|||
implementation,
|
||||
enableAutomaticAdd,
|
||||
tags,
|
||||
retroApplyTags,
|
||||
tagExisting,
|
||||
} = props;
|
||||
|
||||
const { toggleSelected, useIsSelected } = useSelect<ImportList>();
|
||||
|
|
@ -81,8 +81,8 @@ function ManageImportListsModalRow(props: ManageImportListsModalRowProps) {
|
|||
<SeriesTagList tags={tags} />
|
||||
</TableRowCell>
|
||||
|
||||
<TableRowCell className={styles.retroApply}>
|
||||
{retroApplyTags ? translate('Yes') : translate('No')}
|
||||
<TableRowCell className={styles.tagExisting}>
|
||||
{tagExisting ? translate('Yes') : translate('No')}
|
||||
</TableRowCell>
|
||||
</TableRow>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ interface ImportList extends Provider {
|
|||
minRefreshInterval: string;
|
||||
name: string;
|
||||
tags: number[];
|
||||
retroApplyTags: boolean;
|
||||
tagExisting: boolean;
|
||||
}
|
||||
|
||||
export default ImportList;
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
namespace NzbDrone.Core.Datastore.Migration;
|
||||
|
||||
[Migration(231)]
|
||||
public class add_retroapply_to_importlists : NzbDroneMigrationBase
|
||||
public class add_tag_existing_to_importlists : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("ImportLists").AddColumn("RetroApplyTags").AsBoolean().WithDefaultValue(false);
|
||||
Alter.Table("ImportLists").AddColumn("TagExisting").AsBoolean().WithDefaultValue(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@ public class ImportListDefinition : ProviderDefinition, IEquatable<ImportListDef
|
|||
public SeriesTypes SeriesType { get; set; }
|
||||
public bool SeasonFolder { get; set; }
|
||||
public string RootFolderPath { get; set; }
|
||||
public bool RetroApplyTags { get; set; }
|
||||
public bool TagExisting { get; set; }
|
||||
|
||||
[MemberwiseEqualityIgnore]
|
||||
public override bool Enable => EnableAutomaticAdd;
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ private void ProcessListItems(List<ImportListItemInfo> items)
|
|||
// Break if Series Exists in DB
|
||||
if (existingTvdbIds.Any(x => x == item.TvdbId))
|
||||
{
|
||||
RetroApplyTags(importList, item);
|
||||
TagExisting(importList, item);
|
||||
_logger.Debug("{0} [{1}] Rejected, series exists in database", item.TvdbId, item.Title);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -264,9 +264,9 @@ private void ProcessListItems(List<ImportListItemInfo> items)
|
|||
_logger.ProgressInfo("Import List Sync Completed. Items found: {0}, Series added: {1}", items.Count, seriesToAdd.Count);
|
||||
}
|
||||
|
||||
private void RetroApplyTags(ImportListDefinition importList, ImportListItemInfo report)
|
||||
private void TagExisting(ImportListDefinition importList, ImportListItemInfo report)
|
||||
{
|
||||
if (importList.RetroApplyTags)
|
||||
if (importList.TagExisting)
|
||||
{
|
||||
var series = _seriesService.FindByTvdbId(report.TvdbId);
|
||||
|
||||
|
|
|
|||
|
|
@ -1871,8 +1871,8 @@
|
|||
"Result": "Result",
|
||||
"Retention": "Retention",
|
||||
"RetentionHelpText": "Usenet only: Set to zero to set for unlimited retention",
|
||||
"RetroApplyListTagsHelpText": "Retroactively apply tags to series already in {appName}",
|
||||
"RetroApplyTags": "Retroactively Apply Tags",
|
||||
"TagExistingHelpText": "Apply tags to series already in {appName}",
|
||||
"TagExisting": "Tag Existing",
|
||||
"RetryingDownloadOn": "Retrying download on {date} at {time}",
|
||||
"RootFolder": "Root Folder",
|
||||
"RootFolderEmptyHealthCheckMessage": "Empty root folder: {rootFolderPath}",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ public class ImportListBulkResource : ProviderBulkResource<ImportListBulkResourc
|
|||
public bool? EnableAutomaticAdd { get; set; }
|
||||
public string RootFolderPath { get; set; }
|
||||
public int? QualityProfileId { get; set; }
|
||||
public bool? RetroApplyTags { get; set; }
|
||||
public bool? TagExisting { get; set; }
|
||||
}
|
||||
|
||||
public class ImportListBulkResourceMapper : ProviderBulkResourceMapper<ImportListBulkResource, ImportListDefinition>
|
||||
|
|
@ -25,7 +25,7 @@ public override List<ImportListDefinition> UpdateModel(ImportListBulkResource re
|
|||
existing.EnableAutomaticAdd = resource.EnableAutomaticAdd ?? existing.EnableAutomaticAdd;
|
||||
existing.RootFolderPath = resource.RootFolderPath ?? existing.RootFolderPath;
|
||||
existing.QualityProfileId = resource.QualityProfileId ?? existing.QualityProfileId;
|
||||
existing.RetroApplyTags = resource.RetroApplyTags ?? existing.RetroApplyTags;
|
||||
existing.TagExisting = resource.TagExisting ?? existing.TagExisting;
|
||||
});
|
||||
|
||||
return existingDefinitions;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public class ImportListResource : ProviderResource<ImportListResource>
|
|||
public ImportListType ListType { get; set; }
|
||||
public int ListOrder { get; set; }
|
||||
public TimeSpan MinRefreshInterval { get; set; }
|
||||
public bool RetroApplyTags { get; set; }
|
||||
public bool TagExisting { get; set; }
|
||||
}
|
||||
|
||||
public class ImportListResourceMapper : ProviderResourceMapper<ImportListResource, ImportListDefinition>
|
||||
|
|
@ -42,7 +42,7 @@ public override ImportListResource ToResource(ImportListDefinition definition)
|
|||
resource.ListType = definition.ListType;
|
||||
resource.ListOrder = (int)definition.ListType;
|
||||
resource.MinRefreshInterval = definition.MinRefreshInterval;
|
||||
resource.RetroApplyTags = definition.RetroApplyTags;
|
||||
resource.TagExisting = definition.TagExisting;
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
|
@ -66,7 +66,7 @@ public override ImportListDefinition ToModel(ImportListResource resource, Import
|
|||
definition.SeasonFolder = resource.SeasonFolder;
|
||||
definition.ListType = resource.ListType;
|
||||
definition.MinRefreshInterval = resource.MinRefreshInterval;
|
||||
definition.RetroApplyTags = resource.RetroApplyTags;
|
||||
definition.TagExisting = resource.TagExisting;
|
||||
|
||||
return definition;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue