Complete Download Handling Workflow (not deleting files after moving)

Sonarr version (exact version): 3.0.6.1196
Mono version (if Sonarr is not running on Windows):5.18.1.0.r1
OS: ADM 3.5.6.RHA2 (Asustor NAS linux based os)
Debug logs:na
Description of issue:

Hello all,

I’ve been trawling through similar issues but couldn’t find anything that could help me resolve my specific case.

  • I rent a seedbox in another country, the seedbox provider uses rutorrent as its download client
  • Sonarr is running on my NAS
  • Sonnar connects to the download client fine and adds torrents as and when needed so all good so far
  • I use LFTP (with SeedSync front end) to automatically download the completed shows to a “downloaded” folder on my local computer.
  • I am using, and would like to continue to use, LFTP as the seedbox is on another continent and multiple downloads per file allow me to get larger files more quickly. I have previously tried syncthing and manually downloading with filezilla, the downloads were not as fast
  • Sonarr’s Complete Download Handling copies the files over to its respective TV show folders but does not delete them
  • Rutorrent takes care of the files on its end, so no issues with that
  • My question is how can I get Sonarr to automatically delete the files from the “downloaded” folder after it copies them?

you’d need to rig up a custom script as seeding torrents are not deleted

the primary files (video/subs) are typically copied (or hardlinked) but im pretty sure sonarr does not delete them, typically it relies on the download client to clean up the job and its files.

the fact that your seedbox is cleaning up the files there shows that that part is working

well youve lftp’d the files to a local folder so i presume you have a remote path mapping to convert the the seedbox path to that local path which allows sonarr to do the import itself but as mentioned before - cleanup is done by the download client - which is happening as its cleaning up the files up there.

youre going to have to add a custom script connection to cleanup the files it just imported from the local folder (as you downt have a download client to do that for you)


all the parameters are stored in environment variables, and theres a wiki page for it somewhere, you just have to write the script that uses those variables to clean up the right files. i expect it probably already exists as other seedbox people would have run into this before.

note - according to this thread Seedbox with lftp you need to be careful with season packs as it can delete the files after the first file is imported meaning you lose all the other files. perhaps being selective and only deleting the file it just imported, not the whole folder, would be better. just means you need to clean up the empty folders at some point, although no reason you cant add that code to the end of the cleanup script.

Thank you for the information. Guess I’ll have to start digging for a custom script as that’s not something I’ve done before myself. Sorry to beat a dead horse as this has been brought up already… but the return of Drone factory in advanced options with a disclaimer that it is unsupported would be nice…just saying

Or just setup either a remote mount or sync (but have a complete and incomplete folder so it syncs as it downloads) which is the 2021 way of doing things

Drone factory likely won’t ever be coming back

Hmm…while I do appreciate the help, making statements like its the “2021 way of doing things” and “won’t ever be coming back” aren’t really helpful for anyone. If users presented their use cases and a significant number have a problem that does not have an optimal solution, then that can help the developers improve their decision making for future updates as they’ll know what changes will improve the users’ experience. In this specific use case, your suggestion of sync or remote mounting are both suboptimal as they are slower then lftp. Rhom’s suggestion will likely yield the better result but requires technical understanding.

I joined the forum because I wasn’t finding a solution when searching for one, If other people are in the same boat, responses like yours will discourage them from engaging with this forum and the developers might not be aware of what their users want or need.

I don’t believe there are any use cases for drone factory that cannot be handled through existing means.

If you insist on using lftp, then you’d want to check out a usenet/torrent blackhole client.

This thread outlines one specific use case that the “existing” means cannot resolve without a more technical solution like custom scripts. Really don’t see how using a different client helps here , seedbox providers don’t always provide the option to choose download clients and a lot of Sonarr users use seedboxes.

Based on the lack of simple solutions, I think Sonarr at the moment might be missing functionality that a decent number of users might need (unless someone chimes in with something new). Sonarr is a great tool and I am happy to use it, but if the developers want to continue working on it there is no harm pointing out holes in the usability .

That’s you’re 4 solutions for replicating drone factory

  • Custom Script of sorts to clean up the folder
  • Remote Sync - setup so it syncs as it downloads (in a hidden to sonarr folder; then moves to a completed folder) that negates the speed issue
  • remote mount
  • black hole client…meaning sonarr drops the nzb/magenet/torrent in a folder your remote seedbox watches (or is uploaded to said box) and then watches a folder for when the files are complete…you’ll want to ensure the file(s) (especially for season packs) are not prematurely seen by sonarr before they are fully downloaded

Actually for all of these except a remote mount you’ll likely need a cleanup script anyway.

There is a 99.999999% chance drone factory will never be coming back. It caused a ton of issues and confusion. If you don’t like it you’re free to use another app. :smiley:

“If you don’t like it you’re free to use another app” …please stop with that. I will use another app if one comes along that works better for my needs, in the meantime I don’t see any reason why I shouldn’t ask for help here or outline issues with the existing version, unless the moderators decide to prohibit that. You yourself said that all solutions aside from remote mount (which has suboptimal speeds) , requires custom scripts. So there is room for improvement there, maybe not drone factory, but something.

  • My question is how can I get Sonarr to automatically delete the files from the “downloaded” folder after it copies them?

Atm there’s no built in feature for that. Sonarr assumes Remote Path Mappings are actually mounts, and thus applies the ‘this torrent is seeding, i can’t delete it’ logic. But I’m planning to add a switch to Remote Path Mapping at one point that allows you to tell Sonarr that it’s actually a copy, rather than a mount.

In the meantime, using a Custom Script is probably the easiest approach since import events should contain the original file location.

^ This is an example of a post import cleanup script for packed torrents. You can use it as an example, basically you’d just gut all the protections and have it remove everything.

A switch would be awesome for my situation :smiley: , thanks for taking it into consideration.

Thanks for that, much appreciated.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.