mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Sync Reject Blocklisted Torrent Hashes While Grabbing for torrent indexers to Apps
This commit is contained in:
@@ -144,6 +144,7 @@ function EditIndexerModalContent(props) {
|
||||
}) :
|
||||
null
|
||||
}
|
||||
|
||||
<FormGroup
|
||||
advancedSettings={advancedSettings}
|
||||
isAdvanced={true}
|
||||
|
@@ -19,6 +19,7 @@ interface SavePayload {
|
||||
seedRatio?: number;
|
||||
seedTime?: number;
|
||||
packSeedTime?: number;
|
||||
rejectBlocklistedTorrentHashesWhileGrabbing?: boolean;
|
||||
}
|
||||
|
||||
interface EditIndexerModalContentProps {
|
||||
@@ -65,6 +66,10 @@ function EditIndexerModalContent(props: EditIndexerModalContentProps) {
|
||||
const [packSeedTime, setPackSeedTime] = useState<null | string | number>(
|
||||
null
|
||||
);
|
||||
const [
|
||||
rejectBlocklistedTorrentHashesWhileGrabbing,
|
||||
setRejectBlocklistedTorrentHashesWhileGrabbing,
|
||||
] = useState(NO_CHANGE);
|
||||
|
||||
const save = useCallback(() => {
|
||||
let hasChanges = false;
|
||||
@@ -105,6 +110,12 @@ function EditIndexerModalContent(props: EditIndexerModalContentProps) {
|
||||
payload.packSeedTime = packSeedTime as number;
|
||||
}
|
||||
|
||||
if (rejectBlocklistedTorrentHashesWhileGrabbing !== NO_CHANGE) {
|
||||
hasChanges = true;
|
||||
payload.rejectBlocklistedTorrentHashesWhileGrabbing =
|
||||
rejectBlocklistedTorrentHashesWhileGrabbing === 'true';
|
||||
}
|
||||
|
||||
if (hasChanges) {
|
||||
onSavePress(payload);
|
||||
}
|
||||
@@ -118,6 +129,7 @@ function EditIndexerModalContent(props: EditIndexerModalContentProps) {
|
||||
seedRatio,
|
||||
seedTime,
|
||||
packSeedTime,
|
||||
rejectBlocklistedTorrentHashesWhileGrabbing,
|
||||
onSavePress,
|
||||
onModalClose,
|
||||
]);
|
||||
@@ -146,6 +158,9 @@ function EditIndexerModalContent(props: EditIndexerModalContentProps) {
|
||||
case 'packSeedTime':
|
||||
setPackSeedTime(value);
|
||||
break;
|
||||
case 'rejectBlocklistedTorrentHashesWhileGrabbing':
|
||||
setRejectBlocklistedTorrentHashesWhileGrabbing(value);
|
||||
break;
|
||||
default:
|
||||
console.warn(`EditIndexersModalContent Unknown Input: '${name}'`);
|
||||
}
|
||||
@@ -253,6 +268,23 @@ function EditIndexerModalContent(props: EditIndexerModalContentProps) {
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
<FormGroup size={sizes.MEDIUM}>
|
||||
<FormLabel>
|
||||
{translate('IndexerSettingsRejectBlocklistedTorrentHashes')}
|
||||
</FormLabel>
|
||||
|
||||
<FormInputGroup
|
||||
type={inputTypes.SELECT}
|
||||
name="rejectBlocklistedTorrentHashesWhileGrabbing"
|
||||
value={rejectBlocklistedTorrentHashesWhileGrabbing}
|
||||
values={enableOptions}
|
||||
helpText={translate(
|
||||
'IndexerSettingsRejectBlocklistedTorrentHashesHelpText'
|
||||
)}
|
||||
onChange={onInputChange}
|
||||
/>
|
||||
</FormGroup>
|
||||
</ModalBody>
|
||||
|
||||
<ModalFooter className={styles.modalFooter}>
|
||||
|
Reference in New Issue
Block a user