Using external script in quality selection decision process

Sonarr version (exact version): 4.0.9.2244
Mono version (if Sonarr is not running on Windows): 6.0.13
OS: Docker (Linux)
Description of issue:

Hi All,
I’m pretty new to Sonarr, and apologize in advance if this is just not a feature that is currently possible.
What I want to accomplish, is to somehow affect the quality selection process based on an external script or an API.
I did try my best to search for any existing solution, but didn’t find one.
The reason I want this is I use bazarr to download subtitles for all my media, and in many cases the subs just don’t match, even after sync, which puts a lot of load on me to manually fix this.
The current best way I deal with this, is check which release group the subs are made for and override download in Sonarr a release from them - for now this worked flawlessly, but as this is a well defined method, I’d really like to somehow automate it.
If this is not possible at all, and this can be moved to the Feature Requests, I’d also be happy to try and implement such a feature as a PR maybe, if you think this is something that would be accepted.
And if there is some other, even hacky way you think this is possible to accomplish, I’d be happy to hear about it.

Thanks!