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 Readarr support #84

Merged
merged 51 commits into from
Jan 11, 2022
Merged

Add Readarr support #84

merged 51 commits into from
Jan 11, 2022

Conversation

marksie1988
Copy link
Collaborator

@marksie1988 marksie1988 commented Aug 23, 2021

Description

Add support for Readarr, This will also include creating a BaseAPI class that will take duplicated functions into a single file to reduce duplication across the package.

Related issues

Motivation and Context

  • Adds support for new arr products that are being developed.
  • Reduces code size by using a base class

How has this been tested

This is being tested in my lab during development

Types of changes

  • Docs change / refactoring.
  • Non-breaking change (fix or feature that wouldn't cause existing functionality to change/break).
  • Breaking change (fix or feature that would cause existing functionality to change/break).

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes don't generate new warnings.
  • I have read the CONTRIBUTING document.

@marksie1988 marksie1988 added the type/feature New feature or request label Aug 23, 2021
@marksie1988 marksie1988 self-assigned this Aug 23, 2021
@Archmonger
Copy link
Contributor

Archmonger commented Aug 24, 2021

I think the idea of BaseAPI could get sticky as we expand to more than just Sonarr/Radarr.

Not sure if I support the concept, would make scaling to different APIs awkward.

If we're adding Readarr, Bazarr, Lidarr, and Prowlarr support it'd reduce complexity to have code duplication over a base construct.

@marksie1988
Copy link
Collaborator Author

I think the idea of BaseAPI could get sticky as we expand to more than just Sonarr/Radarr.

Not sure if I support the concept, would make scaling to different APIs awkward.

If we're adding Readarr, Bazarr, Lidarr, and Prowlarr support it'd reduce complexity to have code duplication over a base construct.

All of the ARR products are following the same API structure, all base endpoints are the same and are becoming more aligned over time.

The amount of code having to be maintained will be significantly reduced by moving to a base API.

@marksie1988 marksie1988 added the flag/breaking changes A Change that will break current functionality label Jan 8, 2022
@marksie1988 marksie1988 marked this pull request as ready for review January 8, 2022 22:47
@marksie1988
Copy link
Collaborator Author

Hey @Archmonger,

Its been a long while and I've made a lot of changes, If you have some time I would appreciate your review on this one to ensure things are working as expected etc.

Not all Readarr functionality is implemented however I have got the main things people will want working, the main things not implemented are the same as with the Sonarr & Radarr implementation so shouldn't be an issue.

Copy link
Contributor

@Archmonger Archmonger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally don't use Readarr so I haven't done any testing on this PR.

This is purely a code review.

pyarr/readarr.py Outdated Show resolved Hide resolved
pyarr/readarr.py Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
pyarr/request_api.py Outdated Show resolved Hide resolved
pyarr/radarr.py Outdated Show resolved Hide resolved
pyarr/base.py Outdated Show resolved Hide resolved
pyarr/base.py Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 11, 2022

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 21.56%.

Quality metrics Before After Change
Complexity 0.37 ⭐ 0.00 ⭐ -0.37 👍
Method Length 26.94 ⭐ 101.50 🙂 74.56 👎
Working memory 5.66 ⭐ 6.85 🙂 1.19 👎
Quality 88.44% 66.88% 🙂 -21.56% 👎
Other metrics Before After Change
Lines 1738 128 -1610
Changed files Quality Before Quality After Quality Change
pyarr/init.py 99.50% ⭐ 99.00% ⭐ -0.50% 👎
sphinx-docs/conf.py 66.05% 🙂 66.05% 🙂 0.00%

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@marksie1988 marksie1988 merged commit ba6b863 into master Jan 11, 2022
@marksie1988 marksie1988 deleted the 80-add_readarr_support branch January 13, 2022 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag/breaking changes A Change that will break current functionality type/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants