Unmanic / unmanic-plugins

Official plugins for the Unmanic application
21 stars 70 forks source link

Notify Sonarr / Radarr & Trigger Update #149

Open EvilTactician opened 2 years ago

EvilTactician commented 2 years ago

A common problem and point of discussion is Sonarr/Radarr not realising that Unmanic has processed a file and converted it to another codec. If you rely on codecs for your profiles (as in, update the file until it's x265 or something similar), this can lead to issues where a new file is acquired.

SMA solves this by forcing Sonarr/Radarr to update via API. I believe SMA is open source so you can likely look at the code. SMA config includes this;

[Sonarr]
host = localhost
port = 8989
apikey = 
ssl = False
webroot = 
force-rename = True
rescan = True
block-reprocess = False

[Radarr]
host = localhost
port = 7878
apikey = 
ssl = False
webroot = 
force-rename = True
rescan = True
block-reprocess = False

Creating a plugin to notify the *ARR's and force a rename/rescan would be fantastic. We may need a way to specify which folder(s) apply to which service so the plugin knows which to notify - but it would resolve needing to rename or do other workarounds within Unmanic itself.

Protektor-Desura commented 2 years ago

Yes SMA is open source. MIT License https://github.com/mdhiggins/sickbeard_mp4_automator

EvilTactician commented 2 years ago

It's worth noting that we could bypass this altogether by adding an 'append string' option to the conversion plugins.

It would probably have to some regex for both 'find/replace' and 'append' features which you can run in sequence - as that would cover all bases including changing files which already have the codec in the filename.

As this changes the filename, Radarr/Sonarr would re-analyze the file in their maintenance which bypasses the need to update them.

I'm fairly ambivalent about the final solution to be honest, the primary aim is to ensure Radarr/Sonarr "know" that the file has been converted to another codec and avoid loops in people's workflow.

Protektor-Desura commented 2 years ago

This means you are waiting up to 23 hours before Sonarr and Radarr notice the files have changed and I don't believe there is an automatic trigger to rename either which is a problem when you want the filename to reflect the codecs (video & audio) used and subtitles in the video file.

It is a better solution to me to trigger an update and rename via the APIs.

Wdavery commented 2 years ago

This issue has been addressed upstream!

Sonarr: https://github.com/Sonarr/Sonarr/commit/f26540cdc77124440f2bb7431df19b4204a39a32 Not yet released

Radarr: https://github.com/Radarr/Radarr/commit/c538424229eadaed0ec8ce8eace95bd516676841 Released 2 days ago