---
sidebar_position: 4
---

import { 
  ConfigSection, 
  styles 
} from '@site/src/components/documentation';

# How it works

This is a detailed explanation of how the recurring cleanup jobs work.

<div className={styles.documentationPage}>

<div className={styles.section}>

<ConfigSection
  id="content-blocker"
  title="1. Content Blocker"
  description="Automatically filters and removes unwanted content based on configurable blocklists"
  icon="🚫"
>

- Run every 5 minutes (or configured cron).
- Process all items in the *arr queue.
- Find the corresponding item from the download client for each queue item.
- Mark the files that were found in the queue as **unwanted/skipped** if:
  - They **are listed in the blacklist**, or
  - They **are not included in the whitelist**.
- If **all files** of a download **are unwanted**:
  - It will be removed from the *arr's queue and blocked.
  - It will be deleted from the download client.
  - A new search will be triggered for the *arr item.

</ConfigSection>

<ConfigSection
  id="queue-cleaner"
  title="2. Queue Cleaner"
  description="Monitors download progress and removes problematic downloads using a strike system"
  icon="🧹"
>

- Run every 5 minutes (or configured cron, or right after `Content Blocker`).
- Process all items in the *arr queue.
- Check each queue item if it is **stalled (download speed is 0)**, **stuck in metadata downloading**, **failed to be imported** or **slow**.
  - If it is, the item receives a **strike** and will continue to accumulate strikes every time it meets any of these conditions.
- Check each queue item if it meets one of the following condition in the download client:
  - **Marked as completed, but 0 bytes have been downloaded** (due to files being blocked by qBittorrent or the **content blocker**).
  - All associated files are marked as **unwanted/skipped/do not download**.
- If the item **DOES NOT** match the above criteria, it will be skipped.
- If the item **DOES** match the criteria or has received the **maximum number of strikes**:
  - It will be removed from the *arr's queue and blocked.
  - It will be deleted from the download client.
  - A new search will be triggered for the *arr item.

</ConfigSection>

<ConfigSection
  id="download-cleaner"
  title="3. Download Cleaner"
  description="Manages completed downloads based on seeding time, ratio, and hardlink status"
  icon="🧽"
>

- Run every hour (or configured cron).
- Automatically clean up downloads that have been seeding for a certain amount of time.
- Automatically changes the category of downloads that have no hardlinks.

</ConfigSection>

</div>

</div>