Plex integration with Sonarr

I see. And how does it parse downloads with obfuscated filenames?

My problem is that cayar’s script processed the file, it moves the obfuscated file from its original folder to the Drone folder and Sonarr doesn’t recognize the filename anymore when it tries to parse it.

It falls back to the folder name.

Ok, thanks. I got it to work out just fine by enabling SAB’s sorting feature.

So I’m reading up on the pros of completed download handling and came across this:

*** Waits for files to be extracted by your download client and post-processing script run before attempting to move it (should eliminate issues with partially extract files being moved)

Since I’m using a post-processing script that will convert the original TV show release file from MKV to MP4, will Sonarr still be able to pick-up and import the downloaded file accordingly?

Right now I’m using Drone factory to get this all done but I’m trying to move away from it as much as possible.

If the post processing script is run directly in SAB and waits for the execution Sonarr will wait to import and the only other thing the script would need to do is put the file in the same directory as the SAB is reporting (and should clean up the mkv as well).

I already tried that but have had problems with it. Even before the script finishes the conversion, Sonarr detects the mkv file as invalid and somehow detects the mp4 as sample (because of the file being smaller before it is fully converted). And then after the conversion, Sonarr is trying to look for the mkv instead of the mp4. So it seems that Sonarr is not waiting for the script to finish.

This is the basic powershell script that is being run by sab’s post processing:

$ffmpegrunning = (Get-Process ‘ffmpeg’ -ea SilentlyContinue)
if (!$ffmpegrunning)
{
Write-Host "The FFMPEG service is not running"
Set-Location “C:\Convert”
.\manual.py -a -i E:\raw\TV
}
else
{
Write-Host “FFMPEG service running, everything is fine”
}

So it’s basically another script (manual.py) inside the main script. What I’m thinking is that SAB is returning to Sonarr that the PS script has already done its job (run manual.py) and that’s why Sonarr already thinks that the job is done even though manual.py is actually just in the process of converting the file. Am I right?

Yes, if your script returns after queuing the download, but before it completes that would tell Sonarr it’s done. It’ll either need to wait for use the API to tell Sonarr to import it after the conversion (and turn completed download handling off).

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