weannounce / arrnounced

Notify Sonarr/Radarr/Lidarr of tracker IRC announcements.
22 stars 3 forks source link

Support for Multiple Backends of the same type? #16

Closed arbitrarypunter closed 3 years ago

arbitrarypunter commented 4 years ago

Hi I just got going with arrnounced yesterday, it works really well so thanks for your work on it. I was wondering is it possible to support multiple backends of the same type? for example radarr and radarr4k? I had a go at adding in a new section title radarr4k or radarr2 and arrnounced treated them as trackers and complained i hadn't set the irc details. Am i missing something obvious on how to do this or is it not supported in the code?

Thanks!

weannounce commented 4 years ago

Hi That is unfortunately not something which is supported at the moment. The configuration sections "radarr", "sonarr" and "lidarr" are currently hard coded and as you already experienced, any other name will be interpreted as a tracker.

I definitely see the use case for it so I will work towards supporting it. My initial analysis is that it will probably require some hierarchy in the configuration. While I think this is possible with the current configuration library it probably won't feel intuitive. I have been thinking of changing the config format, this might be a good reason to do it. Doing that will probably take a while. Maybe I can work something in until then. I'll keep you posted.

But until then I have a suggestion for a workaround. The API to Radarr and Sonarr are identical so if you do not use Sonarr you could configure Arrnounced to notify Radarr4k as if it was Sonarr. I.e. something like this

[radarr]
url = http://url.to.radarr:1234
apikey = YOUR-API-KEY

[sonarr]
url = http://url.to.radarr4k:1234
apikey = YOUR-API-KEY
arbitrarypunter commented 4 years ago

Sadly i am using both radarr and sonarr so that wouldn't be a solution for me. I did consider just running two instances of the script, but that feels messy, and would obviously mean twice as many connections to the IRC channels.

Thanks for looking at it.

weannounce commented 4 years ago

Too bad the workaround doesn't work for you.

The current configuration library makes this to weird to implement, it's some arbitrary ini format. Instead I've started the transition to TOML which is well defined and at least looks similar .

weannounce commented 3 years ago

The linked pull request gives the ability to configure multiple backends. Check the example config for the new structure and how TOML is used.

I still have some sanity checks to add and after that I will probably test it for a while before making a new release. Feel free to try it out in the meantime and give feedback if you find any issues.