Sonarr/Radarr Integration
direct-play-nice can be wired as a custom script in Sonarr/Radarr pipelines.
High-level flow
- Arr service imports media.
- Custom script invokes
direct_play_nice. - Successful conversion output replaces source according to configured behavior.
Event behavior
The binary auto-detects Sonarr/Radarr custom-script invocations:
sonarr_eventtype=Downloadandradarr_eventtype=Downloadtrigger conversion.- Non-download events (for example
Test,Grab,Rename) exit cleanly.
Naming and replacement notes
- Use
--servarr-output-extensionand--servarr-output-suffixto control output naming. --delete-sourceapplies to direct CLI usage.- In Sonarr/Radarr mode, replacement/rollback logic is handled by integration flow.
--servarr-output-extension match-inputkeeps the source container.
Example command in Sonarr custom script:
/path/to/direct_play_nice --config-file /path/to/direct-play-nice-sonarr.toml
Practical wrapper pattern
For GPU OCR environments, keep a stable wrapper script as the command Sonarr or Radarr calls. This keeps runtime paths and OCR flags centralized.
Example wrapper:
#!/usr/bin/env bash
set -euo pipefail
export ORT_DYLIB_PATH=\"/opt/onnxruntime/lib/libonnxruntime.so\"
export LD_LIBRARY_PATH=\"/opt/onnxruntime/lib:${LD_LIBRARY_PATH:-}\"
exec /path/to/direct_play_nice --config-file /path/to/direct-play-nice-sonarr.toml
This avoids drift between manual shell runs and Arr-triggered runs.
For service-specific script setup, see the Servarr docs: