Add category change for downloads with no additional hardlinks (#65)

This commit is contained in:
Flaminel authored and GitHub committed 2025-05-04 17:26:51 +03:00
1 parent 8cfc73213a
commit 693f80fe6a
49 files changed
+1255 -123

No files matched your search

+2 -1
View File
@@ -32,4 +32,5 @@ This is a detailed explanation of how the recurring cleanup jobs work.
- A new search will be triggered for the *arr item.
#### 3. **Download cleaner** will:
- Run every hour (or configured cron).
- Automatically clean up downloads that have been seeding for a certain amount of time.
- Automatically clean up downloads that have been seeding for a certain amount of time.
- Automatically changes the category of downloads that have no hardlinks.
@@ -0,0 +1,19 @@
---
sidebar_position: 3
---
import DownloadCleanerHardlinksSettings from '@site/src/components/configuration/download-cleaner/DownloadCleanerHardlinksSettings';
import { Important } from '@site/src/components/Admonition';
# Hardlinks Settings
These settings control how the Download Cleaner handles downloads with no hardlinks remaining (they are not available in the arrs anymore).
The Download Cleaner will change the category of a download that has no hardlinks and the new category can be cleaned based on the rules configured [here](/docs/configuration/download-cleaner/categories).
<Important>
If you are using Docker, make sure to mount the downloads directory the same way it is mounted for the download client.
If your download client's download directory is `/downloads`, it should be the same for Cleanuperr.
</Important>
<DownloadCleanerHardlinksSettings/>
@@ -79,6 +79,17 @@ services:
- DOWNLOADCLEANER__CATEGORIES__1__MAX_RATIO=-1
- DOWNLOADCLEANER__CATEGORIES__1__MIN_SEED_TIME=0
- DOWNLOADCLEANER__CATEGORIES__1__MAX_SEED_TIME=240
# remove downloads with no hardlinks
- DOWNLOADCLEANER__CATEGORIES__2__NAME=cleanuperr-unlinked
- DOWNLOADCLEANER__CATEGORIES__2__MAX_RATIO=-1
- DOWNLOADCLEANER__CATEGORIES__2__MIN_SEED_TIME=0
- DOWNLOADCLEANER__CATEGORIES__2__MAX_SEED_TIME=0
# change category for downloads with no hardlinks
- DOWNLOADCLEANER__UNLINKED_TARGET_CATEGORY=cleanuperr-unlinked
- DOWNLOADCLEANER__UNLINKED_IGNORED_ROOT_DIR=/downloads
- DOWNLOADCLEANER__UNLINKED_CATEGORIES__0=tv-sonarr
- DOWNLOADCLEANER__UNLINKED_CATEGORIES__1=radarr
- DOWNLOAD_CLIENT=none
# OR
@@ -131,6 +142,7 @@ services:
- NOTIFIARR__ON_SLOW_STRIKE=true
- NOTIFIARR__ON_QUEUE_ITEM_DELETED=true
- NOTIFIARR__ON_DOWNLOAD_CLEANED=true
- NOTIFIARR__ON_CATEGORY_CHANGED=true
- NOTIFIARR__API_KEY=notifiarr_secret
- NOTIFIARR__CHANNEL_ID=discord_channel_id
@@ -139,6 +151,7 @@ services:
- APPRISE__ON_SLOW_STRIKE=true
- APPRISE__ON_QUEUE_ITEM_DELETED=true
- APPRISE__ON_DOWNLOAD_CLEANED=true
- NOTIFIARR__ON_CATEGORY_CHANGED=true
- APPRISE__URL=http://apprise:8000
- APPRISE__KEY=myConfigKey
```
@@ -69,8 +69,20 @@ import { Note } from '@site/src/components/Admonition';
"MAX_RATIO": 1,
"MIN_SEED_TIME": 0,
"MAX_SEED_TIME": 240
},
{
"Name": "cleanuperr-unlinked",
"MAX_RATIO": 1,
"MIN_SEED_TIME": 0,
"MAX_SEED_TIME": 240
}
],
"UNLINKED_TARGET_CATEGORY": "cleanuperr-unlinked",
"UNLINKED_IGNORED_ROOT_DIR": "/downloads",
"UNLINKED_CATEGORIES": [
"tv-sonarr",
"radarr"
],
"IGNORED_DOWNLOADS_PATH": "/ignored.txt"
},
"DOWNLOAD_CLIENT": "none",
@@ -149,6 +161,7 @@ import { Note } from '@site/src/components/Admonition';
"ON_SLOW_STRIKE": true,
"ON_QUEUE_ITEM_DELETED": true,
"ON_DOWNLOAD_CLEANED": true,
"ON_CATEGORY_CHANGED": true,
"API_KEY": "notifiarr_secret",
"CHANNEL_ID": "discord_channel_id"
},
@@ -158,6 +171,7 @@ import { Note } from '@site/src/components/Admonition';
"ON_SLOW_STRIKE": true,
"ON_QUEUE_ITEM_DELETED": true,
"ON_DOWNLOAD_CLEANED": true,
"ON_CATEGORY_CHANGED": true,
"URL": "http://localhost:8000",
"KEY": "myConfigKey"
}
@@ -0,0 +1,43 @@
import React from "react";
import EnvVars, { EnvVarProps } from "../EnvVars";
const settings: EnvVarProps[] = [
{
name: "DOWNLOADCLEANER__UNLINKED_TARGET_CATEGORY",
description: [
"The category to set on downloads that do not have hardlinks."
],
type: "text",
defaultValue: "cleanuperr-unlinked",
required: false,
},
{
name: "DOWNLOADCLEANER__UNLINKED_IGNORED_ROOT_DIR",
description: [
"This is useful if you are using [cross-seed](https://www.cross-seed.org/).",
"The downloads root directory where the original and cross-seed hardlinks reside. All other hardlinks from this directory will be treated as if they do not exist (e.g. if you have a download with the original file and a cross-seed hardlink, it will be deleted).",
],
type: "text",
defaultValue: "Empty",
required: false,
},
{
name: "DOWNLOADCLEANER__UNLINKED_CATEGORIES__0",
description: [
"The categories of downloads to check for available hardlinks.",
{
type: "code",
title: "Multiple patterns can be specified using incrementing numbers starting from 0.",
content: `DOWNLOADCLEANER__UNLINKED_CATEGORIES__0=tv-sonarr
DOWNLOADCLEANER__UNLINKED_CATEGORIES__1=radarr`
}
],
type: "text",
defaultValue: "Empty",
required: false,
}
];
export default function DownloadCleanerHardlinksSettings() {
return <EnvVars vars={settings} />;
}
@@ -68,6 +68,16 @@ const settings: EnvVarProps[] = [
required: false,
acceptedValues: ["true", "false"],
},
{
name: "APPRISE__ON_CATEGORY_CHANGED",
description: [
"Controls whether to notify when a download's category is changed."
],
type: "boolean",
defaultValue: "false",
required: false,
acceptedValues: ["true", "false"],
}
];
export default function AppriseSettings() {
@@ -70,6 +70,16 @@ const settings: EnvVarProps[] = [
defaultValue: "false",
required: false,
acceptedValues: ["true", "false"],
},
{
name: "NOTIFIARR__ON_CATEGORY_CHANGED",
description: [
"Controls whether to notify when a download's category is changed."
],
type: "boolean",
defaultValue: "false",
required: false,
acceptedValues: ["true", "false"],
}
];
-1
View File
@@ -3,7 +3,6 @@ import clsx from "clsx";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Layout from "@theme/Layout";
import HomepageFeatures from "@site/src/components/HomepageFeatures";
import Heading from "@theme/Heading";
import styles from "./index.module.css";