Add radarr config option for setting minimum availability#212
Add radarr config option for setting minimum availability#212Jno21 wants to merge 3 commits intonylonee:mainfrom Jno21:add-config-for-minimum-availability-for-movies
Conversation
WalkthroughThe changes introduce a new configuration option for Radarr by adding a Changes
Sequence Diagram(s)sequenceDiagram
participant User as User/Application
participant CU as ConfigUtils
participant RC as RadarrConfiguration
participant RP as RadarrPost
participant API as Radarr API
User->>CU: Load configuration
CU->>RC: Populate fields (including radarrMinimumAvailability)
RC->>RP: Create RadarrPost object with minimumAvailability
User->>RP: Trigger API call via addToRadarr
RP->>API: Send Radarr request with minimumAvailability included
API-->>RP: Return response
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Graph Analysis (1)src/test/scala/configuration/ConfigurationUtilsSpec.scala (2)
🔇 Additional comments (6)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/resources/config-template.yaml (1)
57-59: Looks good, but please remove trailing whitespace.The new configuration option is well-documented with clear explanations of its purpose and possible values. However, there are trailing spaces on lines 57 and 58 that should be removed.
-## Defines when your Radarr should look for this particular item. DEFAULT: "released". POSSIBLE VALUES: "tba", "announced", "inCinemas", "released", "deleted" -# minimumAvailability: "released" +## Defines when your Radarr should look for this particular item. DEFAULT: "released". POSSIBLE VALUES: "tba", "announced", "inCinemas", "released", "deleted" +# minimumAvailability: "released"🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 57-57: trailing spaces
(trailing-spaces)
[error] 58-58: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/main/resources/config-template.yaml(1 hunks)src/main/scala/configuration/Configuration.scala(1 hunks)src/main/scala/configuration/ConfigurationRedactor.scala(1 hunks)src/main/scala/configuration/ConfigurationUtils.scala(2 hunks)src/main/scala/configuration/Keys.scala(1 hunks)src/main/scala/radarr/RadarrPost.scala(1 hunks)src/main/scala/radarr/RadarrUtils.scala(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/main/scala/configuration/ConfigurationUtils.scala (2)
src/main/scala/configuration/FileAndSystemPropertyReader.scala (1)
getConfigOption(52-58)src/main/scala/configuration/SystemPropertyReader.scala (1)
getConfigOption(4-4)
🪛 YAMLlint (1.35.1)
src/main/resources/config-template.yaml
[error] 57-57: trailing spaces
(trailing-spaces)
[error] 58-58: trailing spaces
(trailing-spaces)
🔇 Additional comments (7)
src/main/scala/configuration/Configuration.scala (1)
31-31: Looks good: New configuration field correctly added.Adding the
radarrMinimumAvailabilityfield to theRadarrConfigurationcase class follows the existing naming convention and is well-integrated with the existing structure.src/main/scala/radarr/RadarrPost.scala (1)
8-8: Looks good: New Radarr API field added.The
minimumAvailabilityfield has been properly added to theRadarrPostcase class and will be included in the API request to Radarr.src/main/scala/configuration/ConfigurationRedactor.scala (1)
23-23: Looks good: Configuration redactor updated to include new field.The new field is correctly added to the string representation of the configuration, maintaining consistent formatting with other fields.
src/main/scala/configuration/Keys.scala (1)
14-20: LGTM! The addition of the radarrMinimumAvailability key is clean and follows the existing pattern.The new constant has been properly added to the Radarr-related keys section with consistent naming and formatting, maintaining the established pattern of the codebase.
src/main/scala/configuration/ConfigurationUtils.scala (2)
38-40: LGTM! The radarrMinimumAvailability configuration retrieval looks good.The new variable is properly initialized with a sensible default value of "released" and follows the same pattern as other configuration options. The code formatting for the surrounding variables has been adjusted to maintain consistent alignment.
69-69: LGTM! The RadarrConfiguration constructor parameter has been properly added.The new parameter is correctly passed to the RadarrConfiguration constructor, ensuring the configuration value is available throughout the application.
src/main/scala/radarr/RadarrUtils.scala (1)
38-38: LGTM! The minimumAvailability parameter is correctly passed to the RadarrPost constructor.This change completes the implementation by passing the new configuration value to the RadarrPost object, which will be used in the API call to Radarr.
AhmedNSidd
left a comment
There was a problem hiding this comment.
Thanks for fixing the tests! I looked over the changes and they look good to me. If we can get this merged in, we can close the original PR without merging.
|
Up @nylonee |
Description
I was noticing that some movies that my family added to the Plex Watchlist weren't being downloaded automatically. Upon further investigation, this was because they had not been fully released, and instead were just released in cinemas. Currently Overseerr offers a configuration option for setting a minimum availability for media requests in Radarr, so I thought it'd be appropriate to have an option for this in Watchlistarr as well.
Contributor:
Took the PR of AhmedNSidd - #149. To update test.
Checklist
sbt scalafmtAllRun (and optionallysbt scalafmtSbt)Summary by CodeRabbit