feat(rules): add ARR disk target path selection for disk space rules#2461
Conversation
- add Disk Target dropdown for Radarr/Sonarr disk space rules - support Aggregate (default) or a specific Arr-reported path - use selected path during disk space evaluation - keep existing rules unchanged in Aggregate mode
|
I was the one that requested this - happy to test it if that's helpful! As a total sidetone, I suspect disk related data could also come from Tracearr in the future as it seems to have a robust view of storage use (now and predicted). Thanks again! |
Yes, I agree on this. It should be server agnostic, DRY, and at the same time consistent with the rest of the code and easy to understand and maintain. Didn't deep dive into the code, but I suppose the drop-down is conditional and only displayed for the space rule? |
…, #2442, #2406, #2386, #2370 PR #2466 - fix: honor Jellyfin played threshold - Respect configured played percentage threshold for Jellyfin watch status PR #2461 - feat(rules): add ARR disk target path selection for disk space rules - Allow selecting specific disk target paths for Radarr/Sonarr disk space rules PR #2458 - feat: clean up empty ended shows in Sonarr after season actions - Automatically remove ended shows from Sonarr when all seasons are processed PR #2453 - fix: improve Plex viewCount reliability and add isWatched boolean - Use native Plex viewCount field with watch history fallback - Add new isWatched boolean rule property PR #2452 - build(deps): bump actions/download-artifact from 7 to 8 PR #2451 - build(deps): bump actions/upload-artifact from 6 to 7 PR #2442 - fix(server): reject null/undefined in numeric rule comparisons - Add getComparisonResult wrapper that fails closed on null/undefined operands - Strict type checking for BIGGER/SMALLER comparisons PR #2406 - Metadata provider abstraction layer with TVDB support - Add MetadataService as central metadata resolution layer - TVDB support as alternative metadata provider - Dynamic provider preference with fallback - Replace TmdbIdService with unified MetadataService PR #2386 - feat: missing_episode rules - Add missing episode count as a rule property for Sonarr PR #2370 - build(deps-dev): bump the eslint group with 2 updates
|
This is now included in the You can check the latest commits here: https://github.com/Maintainerr/Maintainerr/commits/jellyfin-dev
Thank you very much! 🚀 |
|
Just pulled this down to test. The fix does work for Radarr, but not Sonarr, and I can now show the exact asymmetry between the two which may be helpful for you all to be aware of, though I don't know if anything further can happen on this side. Environment:
Radarr (working): System Status → Disk Space correctly shows /movies at 6.9 TiB free / 26.2 TiB total — the NAS filesystem, not the container root. Sonarr (broken): System Status → Disk Space only lists /, /config, and /downloads, all resolving to the container root (232.2 GiB). /tv does not appear, despite being correctly mounted and showing 6.9 TiB free in Sonarr's own Root Folders settings under Media Management. Root cause hypothesis: |
|
@tumeden Do you have any plans to work further on this? |
Changes pushed: Fix Sonarr disk target & DRY refactorRoot cause (Sonarr not working)Sonarr's Fix: A new Why remaining-space vs total-space are handled differentlyThe
A UI: preserved saved pathPreviously, opening a rule for editing while the ARR was temporarily unreachable would silently clear the configured disk path (downgrading a targeted rule to aggregate mode). Now the saved path is preserved in the dropdown with a "(saved selection)" label. For total-space rules, root-folder-only paths are hidden from the dropdown since they can't be evaluated accurately. DRY improvements
Files changed (14)Contracts:
Server:
UI:
All 504 tests pass. Format and type-check clean. |
Sonarr's /diskspace API excludes NFS/CIFS network mounts (DriveType.Fixed only), so Docker bind-mounted media paths like /tv never appear. Radarr includes DriveType.Network, so it works already. Fix: merge /rootfolder data into diskspace results in the base ServarrApi class (getDiskspaceWithRootFolders) for remaining-space rules and the UI path picker. Total-space rules use raw /diskspace to avoid inaccurate values from root-folder fallback entries. Additional changes: - Move ArrDiskspaceResource interface + normalizeDiskPath to @maintainerr/contracts, eliminating triple duplication - Add DISKSPACE_REMAINING_PROPERTY / DISKSPACE_TOTAL_PROPERTY constants to contracts, replace magic strings in UI and server - Extract evaluateArrDiskspaceGiB() to eliminate ~30-line copy-paste between radarr-getter and sonarr-getter - Move getPropFromTuple outside React component (avoid re-creation) - Preserve saved disk path in UI dropdown when ARR is unreachable instead of silently clearing it - Add hasAccurateTotalSpace flag to track root-folder fallback entries - Mark RootFolder.totalSpace as optional (not in Sonarr/Radarr API) - Add diskspace tests for both getter services - Move test fixtures to shared test/utils/data.ts
28101ca to
697f445
Compare
PR #2461 - feat(rules): add ARR disk target path selection for disk space rules - Add Disk Target dropdown for Radarr/Sonarr disk space rules - Support Aggregate (default) or specific Arr-reported path - Fix Sonarr disk target (NFS/CIFS mounts not in /diskspace API) - Merge /rootfolder data into diskspace results for remaining-space rules - Move ArrDiskspaceResource + normalizeDiskPath to @maintainerr/contracts - Extract evaluateArrDiskspaceGiB() to eliminate copy-paste between getters - Add diskspace tests for both getter services
|
@azurecrash Hey! Thanks for testing. Please pull the latest changes (also included in the |
|
Works! Thanks very much, this is awesome! |
|
@azurecrash Thanks for confirming! |
|
🎉 This PR is included in version 3.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
This PR adds path targeting for Radarr/Sonarr disk space rules.
Why
Users running containerized Arr setups need to evaluate free space on media mounts (for example
/movies,/shows) instead of only using a generic aggregate value.Feature request:
https://features.maintainerr.info/posts/151/disk-space-on-other-mounts-not-just-root-containerized-radarr-sonarr-deployments
Notes
I did basic testing for these changes. I don’t currently run Sonarr/Radarr in Docker, so I couldn’t directly verify the Docker-specific mount-path scenario but this change adds more granular configuration when it comes to disk space rules.