Sonarr post processing script

Sonarr version (exact version): 2.0.0.4949
Mono version (if Sonarr is not running on Windows):
OS: Windows 10 Enterprise x64
((Debug logs)): N/A
(Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here)
Description of issue:

  1. Is there a way to get rid of the “Enable Completed Download Handling or configure Drone factory” warning? I intentionally do this because I have a postSonarr.py custom script setup that would do the same.

  2. This is the code of postSonarr.py:

https://pastebin.com/TXQS1zLm

I’m more of a Powershell guy so I can only use context clues when reading Python code. Does this code also convert from Mkv to Mp4? I setup my system so that the conversion happens in SAB after the download and before it gives it to Sonarr. Now in reality, when Sonarr runs the postSonarr.py, I don’t see any double conversion that’s happening and it just imports it the right way. I’m just wondering though, why is there an MkvToMp4 block and is not even being used? I don’t see an if statement there that checks if the file is already an MP4 or not.

Not currently.

A custom script in Sonarr? That wouldn’t execute until after inporting, which wouldnt happen if both are disabled and nothing tells Sonarr to import.

SAB has a post-processing script (SABPostProcess.py) that tells Sonarr to import it. Like I said, I don’t have problems with the import, it works well.

I simply want to know how the PostSonarr.py works (my questions above).

I see. Moved to 3rd party addons since it’s about a 3rd party script, but you may have better luck contacting the author directly.

Yeah I did. I just figured I post it here also because I saw the same script in another thread here.

1 Like

I’m not sure what happened but that warning that I’m talking about is now gone. Was it removed from the latest version of Sonarr?

EDIT: I tried enabling and disabling completed download handling again and the warning came back. Does it mean that this warning will disappear after a certain amount of time?

No, it’ll be there as long as the health check for it detects the problem.

Do you have a clue why it was removed on my system then?

Unless there was an error checking the only thing that comes to mind is CDH was enabled, health checks were run and passed then CDH was disabled again.

Second time it happened and here’s proof:

@markus101

Any thoughts?

Also, when a custom script in Sonarr is set to fire after a Rename, will the custom script be triggered simultaneously by multiple renames or will it be triggered one after the other (finish processing the one that was triggered first before moving to the next run of the same script)?

Only that health checks didn’t run yet (or ran and aborted in a way that cleared the error, but not sure that’s even possible).

After Rename (manually invoked rename from the series details or series editor) or On Download (after the file is imported from the download client)?

With CDH Sonarr will import one download then run scripts then the next, so they’d be run in series. If you use the API to tell Sonarr to import and tell it to import a download before another completes then they could run in parallel.

Ok. It’s back to having that warning again. It’a just weird tha it come and goes.

Yes, I don’t have issues when the script is run on Download. With CDH disabled, SAB has a post-processing script that tells Sonarr to import the downloaded release. SAB does this in series also, so there is no potential problem or whatsoever.

I’m more concerned in the Rename part. So if I do a manual rename of multiple files (using Series editor), then all affected media files will be processed in series, correct?

Correct and at the end of each series being renamed On Rename will be called once to tell you files have been renamed.

If you renamed 5 series it’ll be called 5 times, in series. If you rename one series via the series editor or via series details it’ll be called once.

Basically it’s:

  1. Rename first series
  2. Execute connections (including custom scripts) for that series with the On Rename event
  3. Rinse and repeat

Gotcha! I guess I won’t have any problems then. Thanks!

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