---
sidebar_position: 3
---

import useBaseUrl from '@docusaurus/useBaseUrl';
import {
  ConfigSection,
  Important,
  Warning,
  ElementNavigator,
  SectionTitle,
  PrefixedSection,
  ClickableImage,
  styles
} from '@site/src/components/documentation';

# Queue Cleaner

The Queue Cleaner monitors your *arr's queues and automatically removes downloads based on configurable criteria. This helps keep your queue clean and prevents problematic downloads from being stuck.

<ElementNavigator />

<div className={styles.documentationPage}>

<div className={styles.section}>

<ConfigSection
  title="Enable Queue Cleaner"
  icon="🔄"
>

When enabled, the Queue Cleaner will run according to the configured schedule to automatically clean downloads from your download client queue.

</ConfigSection>

<ConfigSection
  title="Scheduling Mode"
  icon="📅"
>

Choose how to configure the Queue Cleaner schedule:
- **Basic**: Simple interval-based scheduling (every X minutes/hours/seconds)
- **Advanced**: Full cron expression control for complex schedules

</ConfigSection>

<ConfigSection
  title="Cron Expression"
  icon="⏲️"
>

Enter a valid Quartz cron expression to control when the Queue Cleaner runs.

**Common Cron Examples:**
- `0 0/5 * ? * * *` - Every 5 minutes
- `0 0 * ? * * *` - Every hour
- `0 0 */6 ? * * *` - Every 6 hours

</ConfigSection>

<ConfigSection
  title="Ignored Downloads"
  icon="🚫"
>

Downloads matching these patterns will be ignored by Queue Cleaner. Patterns can match any of these:
- torrent hash
- qBittorrent tag or category
- Deluge label
- Transmission category (last directory from the save location)
- µTorrent label
- torrent tracker domain

**Examples:**
```
fa800a7d7c443a2c3561d1f8f393c089036dade1
tv-sonarr
qbit-tag
mytracker.com
```

</ConfigSection>

</div>

<PrefixedSection prefix="failed-import">
<div className={styles.section}>

<SectionTitle icon="❌">Failed Import Settings</SectionTitle>

<ConfigSection
  title="Max Strikes"
  icon="⚡"
>

Number of strikes before a failed import download is removed from the queue. Set to 0 to disable failed import cleaning, minimum 3 to enable.

</ConfigSection>

<ConfigSection
  title="Ignore Private"
  icon="🔒"
>

When enabled, private torrents will be skipped during failed import cleaning. This is useful if you want to preserve private tracker content even when imports fail.

<Important>
This setting needs a download client to be configured.
</Important>

</ConfigSection>

<ConfigSection
  title="Delete Private"
  icon="🗑️"
>

When enabled, private torrents that reach the maximum strikes will be deleted from the download client. Use with caution as this will permanently remove the download.

<Warning>
Setting this to true means private torrents will be permanently deleted, potentially affecting your private tracker account by receiving H&R if the seeding requirements are not met.
</Warning>

<Important>
This setting needs a download client to be configured.
</Important>

</ConfigSection>

<ConfigSection
  title="Skip If Not Found In Client"
  icon="🔍"
>

When enabled, torrents that are not found in any enabled torrent client will skip the failed import check. This is useful when the connection between Cleanuparr and your download client is temporarily broken or when the download client is down, preventing accidental removal of private torrents when their privacy status cannot be determined.

<Important>
This setting needs a download client to be configured.
</Important>

</ConfigSection>

<ConfigSection
  title="Pattern Mode"
  icon="🎭"
>

Choose how to handle failed imports based on their patterns:
- **Exclude**: Remove all failed imports except those containing specified patterns.
- **Include**: Remove only failed imports containing specified patterns.

</ConfigSection>

<ConfigSection
  title="Patterns"
  icon="📝"
>

**Examples:**
- `title mismatch`
- `manual import required`
- `recently aired`

When pattern mode is set to `Exclude`, failed imports containing these patterns will be skipped. Everything else will be removed.
When pattern mode is set to `Include`, only failed imports containing these patterns will be removed. Everything else will be skipped.

These patterns can be any substring of the failed import messages. These messsages can be viewed in the queue of your *arr application.

<ClickableImage
  src={useBaseUrl('/img/failed_import_patterns.png')}
  alt="Failed Import Messages Example"
  style={{ borderRadius: '8px', boxShadow: '0 2px 8px rgba(0,0,0,0.1)', maxWidth: '100%' }}
/>

</ConfigSection>

</div>
</PrefixedSection>

<PrefixedSection prefix="stalled">
<div className={styles.section}>

<SectionTitle icon="⏸️">Stalled Download Rules</SectionTitle>

<p className={styles.sectionDescription}>
  Stalled downloads are those that have stopped downloading and show no progress. You can create multiple rules to handle different scenarios based on completion percentage and torrent privacy.
</p>

<Important>
These settings need a download client to be configured.
</Important>

<ConfigSection
  title="Rule Name"
  icon="📝"
>

A descriptive name for this stall rule. This helps you identify the purpose of each rule when managing multiple rules.

</ConfigSection>

<ConfigSection
  title="Enabled"
  icon="✅"
>

Toggle to enable or disable this rule. Disabled rules won't be applied during queue cleaning.

</ConfigSection>

<ConfigSection
  title="Max Strikes"
  icon="⚡"
>

Number of consecutive times a download must be stalled before action is taken. Minimum value is 3.

</ConfigSection>

<ConfigSection
  title="Privacy Type"
  icon="🔒"
>

Determines which torrents this rule applies to:
- **Public Torrents Only**: Rule only applies to public torrents
- **Private Torrents Only**: Rule only applies to private torrents
- **Public and Private Torrents**: Rule applies to all torrents

</ConfigSection>

<ConfigSection
  title="Completion Percentage Range"
  icon="📊"
>

Define the completion percentage range where this rule applies:
- **Min Completion Percentage**: Rule applies once completion exceeds this value. A value of 0 includes torrents at exactly 0% and above.
- **Max Completion Percentage**: Rule applies up to and including this completion percentage.

This allows you to create different rules for different stages of a download. For example, you might be more aggressive with stalled downloads that are only 10% complete versus those that are 90% complete.

</ConfigSection>

<ConfigSection
  title="Reset Strikes on Progress"
  icon="🔄"
>

When enabled, the strike count resets to zero if the download shows progress again. This prevents removal of downloads that temporarily stall but resume downloading.

</ConfigSection>

<ConfigSection
  title="Minimum Progress to Reset"
  icon="📏"
>

Only reset strikes after the torrent downloads at least this amount of data. Leave blank to reset on any progress. This prevents strikes from being reset by minimal progress that doesn't actually indicate the download is healthy.

</ConfigSection>

<ConfigSection
  title="Delete Private from Client"
  icon="🗑️"
>

When enabled, private torrents that reach the maximum strikes will be deleted from the download client. When disabled, they'll only be removed from the *arr queue but remain in your download client.

<Warning>
Setting this to true means private torrents will be permanently deleted, potentially affecting your private tracker account by receiving H&R if the seeding requirements are not met.
</Warning>

</ConfigSection>

<ConfigSection
  title="Downloading Metadata Max Strikes"
  icon="📊"
>

Number of strikes before a download stuck in "Downloading Metadata" state is removed (qBittorrent only). This is separate from the rule system and applies globally.

</ConfigSection>

</div>
</PrefixedSection>

<PrefixedSection prefix="slow">
<div className={styles.section}>

<SectionTitle icon="🐌">Slow Download Rules</SectionTitle>

<p className={styles.sectionDescription}>
  Slow downloads are those downloading below a specified speed threshold. You can create multiple rules to handle different scenarios based on speed, time limits, file size, completion percentage, and torrent privacy.
</p>

<Important>
These settings need a download client to be configured.
</Important>

<ConfigSection
  title="Rule Name"
  icon="📝"
>

A descriptive name for this slow rule. This helps you identify the purpose of each rule when managing multiple rules.

</ConfigSection>

<ConfigSection
  title="Enabled"
  icon="✅"
>

Toggle to enable or disable this rule. Disabled rules won't be applied during queue cleaning.

</ConfigSection>

<ConfigSection
  title="Max Strikes"
  icon="⚡"
>

Number of consecutive times a download must be slow before action is taken. Minimum value is 3.

</ConfigSection>

<ConfigSection
  title="Min Speed"
  icon="🚀"
>

Minimum download speed threshold (e.g., 100KB/s). Downloads consistently below this speed will accumulate strikes. Either minimum speed or maximum time must be specified.

</ConfigSection>

<ConfigSection
  title="Maximum Time (Hours)"
  icon="⏰"
>

Maximum time allowed for downloads in hours. Set to 0 to disable time-based checking. When enabled, downloads that exceed this time limit will accumulate strikes regardless of speed. Either minimum speed or maximum time must be specified.

</ConfigSection>

<ConfigSection
  title="Privacy Type"
  icon="🔒"
>

Determines which torrents this rule applies to:
- **Public Torrents Only**: Rule only applies to public torrents
- **Private Torrents Only**: Rule only applies to private torrents
- **Public and Private Torrents**: Rule applies to all torrents

</ConfigSection>

<ConfigSection
  title="Completion Percentage Range"
  icon="📊"
>

Define the completion percentage range where this rule applies:
- **Min Completion %**: Rule applies once completion exceeds this value. A value of 0 includes torrents at exactly 0% and above.
- **Max Completion %**: Rule applies up to and including this completion percentage.

This allows you to create different rules for different stages of a download. For example, you might tolerate slower speeds early in a download but expect faster speeds once it's mostly complete.

</ConfigSection>

<ConfigSection
  title="Ignore Above Size"
  icon="📦"
>

Downloads larger than this size will be ignored by this rule (e.g., 25 GB). Large files often download slower and may need more time to complete, so you might want to exclude them from aggressive slow download rules.

</ConfigSection>

<ConfigSection
  title="Reset Strikes on Progress"
  icon="🔄"
>

When enabled, the strike count resets to zero if the download speed improves above the minimum threshold. This prevents removal of downloads that temporarily slow down but recover.

</ConfigSection>

<ConfigSection
  title="Delete Private from Client"
  icon="🗑️"
>

When enabled, private torrents that reach the maximum strikes will be deleted from the download client. When disabled, they'll only be removed from the *arr queue but remain in your download client.

<Warning>
Setting this to true means private torrents will be permanently deleted, potentially affecting your private tracker account by receiving H&R if the seeding requirements are not met.
</Warning>

</ConfigSection>

</div>
</PrefixedSection>

</div>