This is for people who:
- download torrents using Transmission (though some of this information might apply to other download clients)
- use Filebot to process episodes fetched by Sonarr
- also use Filebot to process episodes downloaded without Sonarr and/or to process movies
- download compressed files
As you are probably aware of, if you have Filebot set to process all downloaded files, it will interfere with Sonarr’s Completed Download Handling, which means episodes are not automatically detected and imported by Sonarr. The files will not be registered until the periodic task Refresh Series is run, which is once every 12 hours. In the meantime, episodes might be downloaded again, because Sonarr doesn’t know it’s there. And even if an episode is not downloaded twice, it’s still annoying to see the episode as missing in Sonarr. I will show you how you can set things up so that Filebot will post process every file you download (both series and movies), while still letting Sonarr import the files that have been fetched by Sonarr (using Drone Factory). With some download clients, this is easily done using labels. For Transmission, it isn’t quite as straight forward…
Solutions to this problem have already been suggested in related topics, e.g. forcing a refresh after every download. This is just a different approach that I personally prefer.
While I really love Sonarr, my automated media center would not be complete without Filebot. I need it for organising my movies, and also to unzip series, since 90% of the content I download is compressed, and Sonarr doesn’t have that feature yet. I have Transmission (though almost any bit torrent client can do this) set up to run the Filebot Automated Media Center script after a download is complete. The workflow is:
Sonarr fetches new episodes or I download a series/movie manually -> Filebot takes care of everything else when the download is complete.
When a download is complete, Filebot will unzip, rename, clean up and move the file to my Media folder (in which I keep all of my sorted and renamed TV shows and movies). This interferes with Sonarr’s own Completed Download Handling, as it wants to do the same job, but by the time it gets going, Filebot has already moved the files.
So what we want is to have Filebot process every download, but let Sonarr move the files that it has fetched itself. So somehow, Transmission needs to know whether the file was fetched by Sonarr or not. Since Transmission does not support labels, we will do it by changing Sonarr’s download directory to one that differs from Transmission’s default settings, and use this directory kind of like a label. Every torrent in Transmission has environmental variables, and one of these is called TR_TORRENT_DIR. Thus we can filter torrents based on the chosen download directory.
Solution:
Take a look at the Transmission settings in Sonarr: filling in the Category field would make a subfolder inside Transmission’s default download directory, but this is not recommended, as that can mess things up when the Filebot script is running in parent folders. Instead, enable advanced settings and choose a directory outside the default one. E.g. this setup would work:
…/Transmission/Incomplete
…/Transmission/Completed
…/Transmission/Sonarr/Completed
…/Transmission/Sonarr/Drone Factory
The first folder contains all incomplete downloads. The second is for completed downloads which were not fetched by Sonarr. The third is for completed downloads which were fetched by Sonarr (the one we specified above), and the last is our Drone Factory folder.
When that is done, turn off Sonarr’s Completed Download Handling (remember, Filebot is doing all the post processing). Now turn on Drone Factory and set a path like the one above with a scan interval > 0.
All that remains now is to modify Transmission’s post process script with an if/else block. Here’s how I have it set up:
if [[ $TR_TORRENT_DIR == *"Sonarr/Completed"* ]]; then
filebot -script fn:amc --output “$TR_TORRENT_DIR/../Drone Factory” --action move…
else
filebot -script fn:amc --output “/Users/rosemacmini/Media” --action move…
fi
In other words: if the file was fetched by Sonarr, tell Filebot to output it to the Drone Factory, where it can be picked up by Sonarr. In every other case, move the file directly to the Media folder.
Note: the default naming format of the Filebot AMC script is /TV Shows/ShowTitle/SeasonNumber/ShowTile-EpisodeNumber-EpisodeTitle, which means it will create subfolders inside the Drone Factory, thus preventing files from being detected. To prevent this, simply pass a series format expression to the AMC script (e.g. seriesFormat="{n} - {s00e00} - {t}”)
Say goodbye to episodes being downloaded twice!