Updated retro add tags and added the bulk edit for retro tags

This commit is contained in:
scphantm 2026-04-01 21:25:50 -04:00
parent 529c65a346
commit 9e602e48cf
No known key found for this signature in database
GPG key ID: 3512C53D8C6FC41E
7 changed files with 42 additions and 3 deletions

View file

@ -78,6 +78,7 @@ function EditImportListModalContent({
qualityProfileId,
searchOnAdd,
tags,
retroApplyTags,
fields,
} = item;
@ -256,6 +257,18 @@ function EditImportListModalContent({
/>
</FormGroup>
<FormGroup>
<FormLabel>{translate('RadarrRetroactiveApply')}</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="retroApplyTags"
helpText={translate('RetroApplyListTagsHelpText')}
{...retroApplyTags}
onChange={handleInputChange}
/>
</FormGroup>
{fields?.length ? (
<div>
{fields.map((field) => {

View file

@ -18,6 +18,7 @@ interface SavePayload {
qualityProfileId?: number;
minimumAvailability?: string;
rootFolderPath?: string;
retroApplyTags?: boolean;
}
interface ManageImportListsEditModalContentProps {
@ -62,7 +63,8 @@ function ManageImportListsEditModalContent(
);
const [minimumAvailability, setMinimumAvailability] = useState(NO_CHANGE);
const [rootFolderPath, setRootFolderPath] = useState(NO_CHANGE);
const [retroApplyTags, setRetroApplyTags] = useState(NO_CHANGE);
const save = useCallback(() => {
let hasChanges = false;
const payload: SavePayload = {};
@ -91,6 +93,10 @@ function ManageImportListsEditModalContent(
hasChanges = true;
payload.rootFolderPath = rootFolderPath;
}
if (retroApplyTags !== NO_CHANGE) {
hasChanges = true;
payload.retroApplyTags = retroApplyTags === 'enabled';
}
if (hasChanges) {
onSavePress(payload);
@ -103,6 +109,7 @@ function ManageImportListsEditModalContent(
qualityProfileId,
minimumAvailability,
rootFolderPath,
retroApplyTags,
onSavePress,
onModalClose,
]);
@ -124,6 +131,9 @@ function ManageImportListsEditModalContent(
case 'rootFolderPath':
setRootFolderPath(value as string);
break;
case 'retroApplyTags':
setRetroApplyTags(value as string);
break;
default:
console.warn(`EditImportListModalContent Unknown Input: '${name}'`);
}
@ -199,6 +209,18 @@ function ManageImportListsEditModalContent(
onChange={onInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>{translate('RetroApplyTags')}</FormLabel>
<FormInputGroup
type={inputTypes.SELECT}
name="retroApplyTags"
value={retroApplyTags}
values={enableOptions}
onChange={onInputChange}
/>
</FormGroup>
</ModalBody>
<ModalFooter className={styles.modalFooter}>

View file

@ -3,7 +3,7 @@
namespace NzbDrone.Core.Datastore.Migration;
[Migration(241)]
[Migration(243)]
public class add_retroapply_to_importlists : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()

View file

@ -11,6 +11,7 @@ public class ImportListBulkResource : ProviderBulkResource<ImportListBulkResourc
public string RootFolderPath { get; set; }
public int? QualityProfileId { get; set; }
public MovieStatusType? MinimumAvailability { get; set; }
public bool? RetroApplyTags { get; set; }
}
public class ImportListBulkResourceMapper : ProviderBulkResourceMapper<ImportListBulkResource, ImportListDefinition>
@ -29,6 +30,7 @@ public override List<ImportListDefinition> UpdateModel(ImportListBulkResource re
existing.RootFolderPath = resource.RootFolderPath ?? existing.RootFolderPath;
existing.QualityProfileId = resource.QualityProfileId ?? existing.QualityProfileId;
existing.MinimumAvailability = resource.MinimumAvailability ?? existing.MinimumAvailability;
existing.RetroApplyTags = resource.RetroApplyTags ?? existing.RetroApplyTags;
});
return existingDefinitions;

View file

@ -16,6 +16,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 class ImportListResourceMapper : ProviderResourceMapper<ImportListResource, ImportListDefinition>
@ -39,6 +40,7 @@ public override ImportListResource ToResource(ImportListDefinition definition)
resource.ListType = definition.ListType;
resource.ListOrder = (int)definition.ListType;
resource.MinRefreshInterval = definition.MinRefreshInterval;
resource.RetroApplyTags = definition.RetroApplyTags;
return resource;
}
@ -61,6 +63,7 @@ public override ImportListDefinition ToModel(ImportListResource resource, Import
definition.MinimumAvailability = resource.MinimumAvailability;
definition.ListType = resource.ListType;
definition.MinRefreshInterval = resource.MinRefreshInterval;
definition.RetroApplyTags = resource.RetroApplyTags;
return definition;
}

View file

@ -16,7 +16,6 @@ public class ProviderResource<T> : RestResource
public string InfoLink { get; set; }
public ProviderMessage Message { get; set; }
public HashSet<int> Tags { get; set; }
public List<T> Presets { get; set; }
}