Where to extract archives

My setup unpacks all compressed/archived files. I’m not entirely sure where should the files be extracted to for Sonarr to successfully detect them.

Setup:

  • Deluge (a torrent client) running on a remote server;
  • files are copied from remote server to a temporary directory not seen by Sonarr;
  • if archives are detected, they are extracted and archives themselves are removed;
  • final result is moved to Sonarr-monitored directory.

Let’s assume remote’s /deluge-complete directory is remote-path-mapped to /completed locally.
Now two torrents finish downloading, are copied to our local machine in a temporary dir, and are laid out as follows:

$ tree /completed-tmp
/completed-tmp/
├── uncompressed-torrent
│   └── file1.rar
└── compressed-torrent.rar

Note compressed-torrent.rar didn’t come in its own directory - it’s just a single file.

Now our extraction logic runs and moves files-directories to /completed so Sonarr can pick them up.
What would be an appropriate post-extraction directory view for Sonarr to find the episode files?
Would this work for a final view:

$ tree /completed
/completed/
├── uncompressed-torrent
│   └── extracted
│      └── episode01.mkv
└── compressed-torrent.rar
    └── episode02.mkv

Note we created a directory /completed/compressed-torrent.rar/ ourselves; also all archives were removed by our logic.

For the record, I’m using Sonarr v3, running in Docker.

Use unpackerr

Any other extraction hackery is futile and barely works

If you want to build your own way

  • it needs to extract into the exact path being reported by the download client
  • the files shouldn’t appear to sonarr until all files are extracted (think season packs)
  • the files will always be copied or hardlinked and not moved as their torrents so you’ll need to clean those up after import

For such a simple task as extraction, I don’t see justification for adding yet another service to my stack that needs to be configured and maintained. It depends on Sonarr api and that’s additional potential breaking point.

Which the example in the post does; note all processing happens under /completed-tmp; after everything’s done, it moves to /completed.

Which is partly the reason I’m asking this question. When I know where things need to be extracted, I can design cleanup logic accordingly.

What would those reported paths be for both compressed-torrent.rar & uncompressed-torrent/?

Trace logs will show but it is the save location of the torrent