[SOLVED]Move/Delete Extracted Files

Sonarr version: 2.0.0.4146
Mono version (if Sonarr is not running on Windows): 4.2.1
OS: Linux
((Debug logs)) (posted to hastebin or similar):
Description of issue:

Hey guys,

I’m fairly new to Sonarr and love it so far. There’s just one last issue left which needs to be solved.

So here’s the issue:

  1. Download .rar archive using Deluge
  2. Deluge Extractor unpacks the .mkv files into torrents sub-folder
  3. CDH finds the .mkv file and imports it into my media folder (hardlink)
  4. The extracted file still remains inside the torrents subfolder

Now when I decide to delete the episode using Sonarr, only the imported file inside the media folder will be deleted.
Deleting the torrent (+data) in Deluge will only delete the downloaded files and ignore the extracted .mkv.

The extracted file now remains alone inside inside the torrents folder and I have to delete it manually.

Is there a way to make Sonarr move extracted files instead of hardlinking/copying them?
Or make Deluge delete the entire torrents folder, including the extracted file?

Thanks in advance!

EDIT:

The “Remove” settings under CDH is enabled. Finished torrents are being removed automatically by Sonarr, but leaving the extracted file behind.

Since the source is torrent and sonarr does not handle rars you have to use a custom post processing script to clean the extracted files.

I did once had this setup using a vps remote server with CDH and remote path mapping using NFS. For deleting extracted files I use a bash script that checked for rar files if they were present it deleted the video files. This script was executed by sonarr post processing, after importing the video files.

The variables sonarr_episodefile_sourcefolder and sonarr_episodefile_sourcepath were added for this purpose some time ago.

1 Like

Thank you very much! Everything works flawlessly now. Might be a good idea to include this script in future Sonarr releases though. :slight_smile:

For future people with the same issue, make sure to give the script file permissions to be executed.
Here are the custom script settings: http://prntscr.com/bfd7xq

I forgot, this script was designed for transmission-daemon (which doesn’t have labels), sonarr uses the download folder as label. So in your case make sure sonarr_label is the name of the folder above where torrents get downloaded because you’re using deluge.

1 Like

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