Skip to content

Commit 295275d

Browse files
authored
Merge pull request #204 from ManiMatter/dev
Ignore download clients + Bug fixes
2 parents 5d609fe + 568fd69 commit 295275d

18 files changed

+398
-365
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ jobs:
6363
fetch-depth: '0'
6464

6565
- name: Bump version and push tag
66-
if: ${{ github.ref_name == 'stable' }}
66+
if: ${{ github.ref_name == 'latest' }}
6767
id: setversion
6868
uses: anothrNick/github-tag-action@1.36.0
6969
env:
7070
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7171
WITH_V: true
72-
RELEASE_BRANCHES: stable
72+
RELEASE_BRANCHES: latest
7373

7474
- name: Set up QEMU
7575
uses: docker/setup-qemu-action@v3
@@ -96,7 +96,7 @@ jobs:
9696
BRANCH_NAME="${{ github.ref_name }}"
9797
if [[ "$BRANCH_NAME" == "dev" ]]; then
9898
IMAGE_TAG="dev"
99-
elif [[ "$BRANCH_NAME" == "stable" ]]; then
99+
elif [[ "$BRANCH_NAME" == "latest" ]]; then
100100
IMAGE_TAG=${{ steps.setversion.outputs.new_tag }}
101101
else
102102
IMAGE_TAG=$BRANCH_NAME
@@ -116,7 +116,7 @@ jobs:
116116
run: |
117117
BRANCH_NAME="${{ github.ref_name }}"
118118
TAG_LATEST=""
119-
if [[ "$BRANCH_NAME" == "stable" ]]; then
119+
if [[ "$BRANCH_NAME" == "latest" ]]; then
120120
TAG_LATEST="-t $IMAGE_NAME:latest"
121121
fi
122122

README.md

Lines changed: 312 additions & 240 deletions
Large diffs are not rendered by default.

config/config.conf-Example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ PERMITTED_ATTEMPTS = 3
2020
NO_STALLED_REMOVAL_QBIT_TAG = Don't Kill
2121
IGNORE_PRIVATE_TRACKERS = FALSE
2222
FAILED_IMPORT_MESSAGE_PATTERNS = ["Not a Custom Format upgrade for existing", "Not an upgrade for existing"]
23+
IGNORED_DOWNLOAD_CLIENTS = ["emulerr"]
2324

2425
[radarr]
2526
RADARR_URL = http://radarr:7878

config/definitions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
NO_STALLED_REMOVAL_QBIT_TAG = get_config_value('NO_STALLED_REMOVAL_QBIT_TAG', 'feature_settings', False, str, 'Don\'t Kill')
2828
IGNORE_PRIVATE_TRACKERS = get_config_value('IGNORE_PRIVATE_TRACKERS', 'feature_settings', False, bool, True)
2929
FAILED_IMPORT_MESSAGE_PATTERNS = get_config_value('FAILED_IMPORT_MESSAGE_PATTERNS','feature_settings', False, list, [])
30+
IGNORED_DOWNLOAD_CLIENTS = get_config_value('IGNORED_DOWNLOAD_CLIENTS', 'feature_settings', False, list, [])
3031

3132
# Radarr
3233
RADARR_URL = get_config_value('RADARR_URL', 'radarr', False, str)

main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ async def main(settingsDict):
6262
# Start Cleaning
6363
while True:
6464
logger.verbose("-" * 50)
65+
66+
# Refresh qBit Cookie
67+
if settingsDict["QBITTORRENT_URL"]:
68+
await qBitRefreshCookie(settingsDict)
69+
if not settingsDict["QBIT_COOKIE"]:
70+
logger.error("Cookie Refresh failed - exiting decluttarr")
71+
exit()
72+
6573
# Cache protected (via Tag) and private torrents
6674
protectedDownloadIDs, privateDowloadIDs = await getProtectedAndPrivateFromQbit(
6775
settingsDict

src/decluttarr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ async def queueCleaner(
5858
logger.verbose("Cleaning queue on %s:", NAME)
5959
# Refresh queue:
6060
try:
61-
full_queue = await get_queue(BASE_URL, API_KEY, params={full_queue_param: True})
61+
full_queue = await get_queue(BASE_URL, API_KEY, settingsDict, params={full_queue_param: True})
6262
if full_queue:
6363
logger.debug("queueCleaner/full_queue at start:")
6464
logger.debug(full_queue)

src/jobs/remove_failed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def remove_failed(
2828
# Detects failed and triggers delete. Does not add to blocklist
2929
try:
3030
failType = "failed"
31-
queue = await get_queue(BASE_URL, API_KEY)
31+
queue = await get_queue(BASE_URL, API_KEY, settingsDict)
3232
logger.debug("remove_failed/queue IN: %s", formattedQueueInfo(queue))
3333

3434
if not queue:

src/jobs/remove_failed_imports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def remove_failed_imports(
1818
# Detects downloads stuck downloading meta data and triggers repeat check and subsequent delete. Adds to blocklist
1919
try:
2020
failType = "failed import"
21-
queue = await get_queue(BASE_URL, API_KEY)
21+
queue = await get_queue(BASE_URL, API_KEY, settingsDict)
2222
logger.debug("remove_failed_imports/queue IN: %s", formattedQueueInfo(queue))
2323
if not queue:
2424
return 0

src/jobs/remove_metadata_missing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def remove_metadata_missing(
2828
# Detects downloads stuck downloading meta data and triggers repeat check and subsequent delete. Adds to blocklist
2929
try:
3030
failType = "missing metadata"
31-
queue = await get_queue(BASE_URL, API_KEY)
31+
queue = await get_queue(BASE_URL, API_KEY, settingsDict)
3232
logger.debug("remove_metadata_missing/queue IN: %s", formattedQueueInfo(queue))
3333
if not queue:
3434
return 0

src/jobs/remove_missing_files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async def remove_missing_files(
2828
# Detects downloads broken because of missing files. Does not add to blocklist
2929
try:
3030
failType = "missing files"
31-
queue = await get_queue(BASE_URL, API_KEY)
31+
queue = await get_queue(BASE_URL, API_KEY, settingsDict)
3232
logger.debug("remove_missing_files/queue IN: %s", formattedQueueInfo(queue))
3333
if not queue:
3434
return 0

0 commit comments

Comments
 (0)