Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sabnzbd Support #141

Merged
merged 2 commits into from
Apr 3, 2023
Merged

Add Sabnzbd Support #141

merged 2 commits into from
Apr 3, 2023

Conversation

rtrox
Copy link
Collaborator

@rtrox rtrox commented Apr 1, 2023

Description of the change

This PR adds preliminary support for SabnzbD. Due to the differences in APIs between the two apps, this requires some adjustment to our folder structure. To accomodate this change, and to prepare for adding other apps, like qbittorrent, each app type has it's own package, with it's own models, config, and authentication, leveraging common client, config, and command constructs.

Commands themselves stay in one package, as debugging conflicts in command names can get a bit frustrating if sub commands are spread throughout the projects.

Benefits

1.) SabnzbD Support, yay!
2.) I can stop maintaining prometheus-sabnzbd-exporter, yay!
3.) Project layout is ready to add new apps as we're ready.

Possible drawbacks

A bit more complexity, and it's a big PR :-/

If it's easier, glad to walk through it with you in discord.

Applicable issues

Additional information

There's a lot of files changed here, but the big structural changes are what we talked about:

  1. Config is split into common config, which lives in the root package, and arr/sab config, which lives with those collectors. The child configs are fully separate, but are built from the common config. Only the child config is passed into the collector, so they are fully self-contained.
  2. The root client package stripped out all the arr-specific pieces, but kept it's status code handling, json unmarshalling, panic recovery, etc. The arr-specific pieces (and sab equivalents) live in the collector packages. In *arr, this is just the authenticators, which are passed into base client creation. For Sab, there is also a wrapper function to clean up DoReqeuest callsites, since all important stuff for Sab is in query params.
  3. Models is split up by collector. This is really for isolation of concerns, there's no naming conflicts yet.
  4. Flattened some directory structures -- we were already isolating collectors by name in Arr, so the Arr collectors are all in one collector package now.

@rtrox rtrox requested a review from onedr0p as a code owner April 1, 2023 00:47
Signed-off-by: Russell Troxel <russell@troxel.io>
@onedr0p
Copy link
Owner

onedr0p commented Apr 2, 2023

I've been sick over the past few days but should hopefully start feeling better soon and will take a look at this. I'm excited for this!

@rtrox
Copy link
Collaborator Author

rtrox commented Apr 3, 2023

Sorry to hear that, feel better! No rush here :-)

Signed-off-by: Russell Troxel <russell@troxel.io>
@rtrox rtrox mentioned this pull request Apr 3, 2023
@onedr0p
Copy link
Owner

onedr0p commented Apr 3, 2023

Great work here, the structure makes sense too.

@onedr0p onedr0p merged commit 6dcb7b4 into master Apr 3, 2023
@onedr0p onedr0p deleted the sabnzbd branch April 4, 2023 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: Add support for sabnzbd
2 participants