ManiMatter / decluttarr

Watches radarr, sonarr, lidarr, readarr and whisparr download queues and removes downloads if they become stalled or no longer needed.
GNU General Public License v3.0
99 stars 15 forks source link

Not deleting orphans from qbittorrent #90

Closed soredake closed 2 months ago

soredake commented 2 months ago

I've set decluttarr to delete orphans from qbittorrent, but for some reason they are not removed.

docker-compose:

  decluttarr:
    image: ghcr.io/manimatter/decluttarr:latest
    container_name: decluttarr
    restart: unless-stopped
    environment:
      - TZ=Etc/UTC
      - PUID=1001
      - PGID=1001
      ## General
      - LOG_LEVEL=VERBOSE
      #- TEST_RUN=True
      #- SSL_VERIFICATION=False
      ## Features
      - REMOVE_TIMER=10
      - REMOVE_FAILED=True
      - REMOVE_METADATA_MISSING=True
      - REMOVE_MISSING_FILES=True
      - REMOVE_NO_FORMAT_UPGRADE=True
      - REMOVE_ORPHANS=True
      - REMOVE_SLOW=False
      - REMOVE_STALLED=True
      - REMOVE_UNMONITORED=True
      - MIN_DOWNLOAD_SPEED=100
      - PERMITTED_ATTEMPTS=3
      - NO_STALLED_REMOVAL_QBIT_TAG=Don't Kill
      - IGNORE_PRIVATE_TRACKERS=False
      ## Radarr
      - RADARR_URL=http://radarr:7878
      - RADARR_KEY=
      ## Sonarr
      - SONARR_URL=http://sonarr:8989
      - SONARR_KEY=
      ## Lidarr
      - LIDARR_URL=http://lidarr:8686
      - LIDARR_KEY=
      ## Readarr
      - READARR_URL=http://readarr:8787
      - READARR_KEY=
      ## qBittorrent
      - QBITTORRENT_URL=http://qbittorrent:22222
      - QBITTORRENT_USERNAME=
      - QBITTORRENT_PASSWORD=

Log:

[INFO   ]: ##################################################
[INFO   ]: Decluttarr - Application Started!
[INFO   ]:
[INFO   ]: *** Current Settings ***
[INFO   ]: Version: v1.41.0
[INFO   ]: Commit: 66ea31b
[INFO   ]:
[INFO   ]: True | Removing failed downloads
[INFO   ]: True | Removing downloads missing metadata
[INFO   ]: True | Removing downloads missing files
[INFO   ]: True | Removing downloads that fail on import (no format upgrade)
[INFO   ]: True | Removing orphan downloads
[INFO   ]: False | Removing slow downloads
[INFO   ]: True | Removing stalled downloads
[INFO   ]: True | Removing downloads belonging to unmonitored items
[INFO   ]:
[INFO   ]: Running every: 0 days 0 hours 10.0 minutes
[INFO   ]: Permitted number of times before stalled/missing metadata/slow downloads are removed: 3
[INFO   ]: Downloads with this tag will be skipped: "Don't Kill"
[INFO   ]: Private Trackers will be skipped: False
[INFO   ]:
[INFO   ]: *** Configured Instances ***
[INFO   ]: Radarr: http://radarr:7878/api/v3
[INFO   ]: Sonarr: http://sonarr:8989/api/v3
[INFO   ]: Lidarr: http://lidarr:8686/api/v1
[INFO   ]: Readarr: http://readarr:8787/api/v1
[INFO   ]: qBittorrent: http://qbittorrent:22222/api/v2
[INFO   ]:
[INFO   ]: *** Check Instances ***
[INFO   ]: OK  | Radarr
[INFO   ]: OK  | Sonarr
[INFO   ]: OK  | Lidarr
[INFO   ]: OK  | Readarr
[INFO   ]: OK | qBittorrent
[INFO   ]:
[INFO   ]: ##################################################
[INFO   ]:
[VERBOSE]: --------------------------------------------------
[VERBOSE]: Cleaning queue on Radarr:
[VERBOSE]: >>> Queue is empty.
[VERBOSE]: Cleaning queue on Sonarr:
[VERBOSE]: >>> Queue is empty.
[VERBOSE]: Cleaning queue on Lidarr:
[VERBOSE]: >>> Queue is empty.
[VERBOSE]: Cleaning queue on Readarr:
[VERBOSE]: >>> Queue is empty.
[VERBOSE]:
[VERBOSE]: Queue clean-up complete!
[VERBOSE]: --------------------------------------------------
[VERBOSE]: Cleaning queue on Radarr:
[VERBOSE]: >>> Queue is empty.
[VERBOSE]: Cleaning queue on Sonarr:
[VERBOSE]: >>> Queue is empty.
[VERBOSE]: Cleaning queue on Lidarr:
[VERBOSE]: >>> Queue is empty.
[VERBOSE]: Cleaning queue on Readarr:
[VERBOSE]: >>> Queue is empty.
[VERBOSE]:
[VERBOSE]: Queue clean-up complete!
ManiMatter commented 2 months ago

Can you please paste a screenshot of radarr or sonarr where you see the orphans in question?

soredake commented 2 months ago

Oh, sorry, it seems I misunderstood how declutarr works, I thought decluttarr can remove orphans from qbittorrent client directly.

ManiMatter commented 2 months ago

What do you understand as „orphan in qbit“?

when a movie is no longer requested in radarr, but a download is in progress, it‘s considered „orphan“. It is removed from qbit by the script and from radarr queue.

soredake commented 2 months ago

What do you understand as „orphan in qbit“?

A finished torrent with radarr or tv-sonarr category that is not linked to any radarr / sonarr library item.

when a movie is no longer requested in radarr, but a download is in progress, it‘s considered „orphan“. It is removed from qbit by the script and from radarr queue.

I see, so my use case of deleting finished orphans in qbittorent is not supported.

ManiMatter commented 2 months ago

I am not sure I understand you.

If a torrent is tagged with "radarr" or "tv-sonarr" and these are the respective tags that your sonarr/radarr apps consider to see which torrents belong to them, then these respective torrents will show up under the radarr/sonarr queue tab.

If now on the main page of radarr/sonarr the respective item has been deleted, if you go to queue you will see the name of the torrent, rather than the name of the movie.

Example: Let's say there's a movie called "Good, Bad, and some Hunting". You started a download of a file called "Good Bad BlueRay 1080p". In queue, you will see "Good, Bad, and some Hunting", ie. not an orphan. Now you delete the movie in Radarr, but the download is still in progress. Now you will see in queue "Good Bad BlueRay 1080p", i.e. an orphan that can't be linked with a movie in your radarr app.

The setting REMOVE_ORPHANS will delete this orphan from radarr, and kill the torrent in qbit.

Therefore, I don't understand your statement "so my use case of deleting finished orphans in qbittorent is not supported."

Can you please explain?

soredake commented 2 months ago

Can you please explain?

I downloaded movie, I deleted movie from radarr, torrent are still there in qbittorrent, I initially thought that declutarr with REMOVE_ORPHANS=True can go to qbittorrent, see that there is a torrent with radarr tag which is not linked to any library item, and delete this torrent, as in my because for me such a torrent is an orphan, that's why I created this issue.

ManiMatter commented 2 months ago

that is exactly what the tool is doing.

can you please share 1) screenshot of radarr queue 2) screenshot of qbit

When you say "I deleted movie from radarr", how did you delete it? Ie., which menu did you use, what options did you select / not select?

soredake commented 2 months ago

can you please share screenshot of radarr queue screenshot of qbit

I have deleted the movie, but replicated the same with deleting+unmonitoring episode from sonarr, after restarting torrent is still there, queue is empty: image image

When you say "I deleted movie from radarr", how did you delete it? Ie., which menu did you use, what options did you select / not select?

From this menu with this option selected: image

ManiMatter commented 2 months ago

I see. That is not what in my tool is called "Orphan".

You actually delete the movie from the "queue". Normally, that should remove the torrent directly. If your qbit is not running when you delete it, that may be the reason why it does not remove it. However, it is then correct that it no longe shows on the queue.

"Orphan" in my app is something else: If you are on the home screen of radarr/sonarr, where you see all movies and tvshows listed, and you delete the movie/tv show there, but a queue item still exists for them, then you will still see those under queue. And my tool kills them from there.

There are legitimate constellations where users want to keep the download in qbit, but not see the queue item anymore (for instance, for private trackers).

Is it correct, and what you essentially want is an additional feature, that does the following?: "REMOVE_QBIT_LEFTOVERS"

Question - why does this situation even arise? why would your torrent not be up and running all the time when you delete something from the arr* queues?

soredake commented 2 months ago

Normally, that should remove the torrent directly

No, radarr does not support deleting from torrent client natively https://github.com/Radarr/Radarr/issues/3918

Is it correct, and what you essentially want is an additional feature, that does the following?:

Yes, it is what I want.

why would your torrent not be up and running all the time when you delete something from the arr* queues?

I can't leave torrents seeding forever, I have a server with very limited space (150gb), and I have some private tracker with low leecher count, so torrents will not be seeded oftenly, or ever.

ManiMatter commented 2 months ago

I am still not sure I understand completely.

When I go to radarr/sonarr, and look at the queue, I see the torrents from qbit. When I then chose (manually) to remove them via the button "Remove selected" under queue-tab, then I see this menu:

Screenshot 2024-04-26 at 18 23 35

If I don't change anything (leave "Remove from download client"), then the torrent gets removed from qbit. If I chose "Ignore Download" then the download stays in qbit, but it's not visible in queue of radarr/sonarr anymore.

So why I'm confused:

So I don't understand how you arrive at a point where you end up with things not being in the queue (not by your own doing) but they are still in qbit?

If we are talking about movies that have completed, and you watched them, you deleted them from the main tab, but when you imported them to radarr you chose to let them still be in qbit so they can continue seeding, then it's a question of "how long do you keep things in qbit after completion" - which is not what the purpose of decluttarr is. Decluttarr helps you actually finishing the download; what you do then (immediately remove it, or keep seeding) is up to you.

There are other solutions out there that help you remove torrents more smartly after having let them seed for a while. see https://github.com/ManiMatter/decluttarr/issues/44

Thanks for adding more details / helping me understand better what is needed here (or whether the tool mentioned in #44) does what you need

soredake commented 2 months ago

If we are talking about movies that have completed, and you watched them, you deleted them from the main tab, but when you imported them to radarr you chose to let them still be in qbit so they can continue seeding, then it's a question of "how long do you keep things in qbit after completion" - which is not what the purpose of decluttarr is. Decluttarr helps you actually finishing the download; what you do then (immediately remove it, or keep seeding) is up to you.

There are other solutions out there that help you remove torrents more smartly after having let them seed for a while. see #44

I see, seems I misunderstood the functionality of this software, sorry!

Anyway, thank you for this great software, it's still useful for me.