Skip to content

Add ARR submitted name folder naming option#264

Open
kw6423 wants to merge 1 commit into
sirrobot01:betafrom
kw6423:arr-submitted-name-folder-option
Open

Add ARR submitted name folder naming option#264
kw6423 wants to merge 1 commit into
sirrobot01:betafrom
kw6423:arr-submitted-name-folder-option

Conversation

@kw6423
Copy link
Copy Markdown

@kw6423 kw6423 commented Apr 28, 2026

📌 Description

  • Adds a new ARR submitted name folder naming option for WebDAV / external rclone paths.
  • This keeps the release name sent by Sonarr, Radarr, or another client, such as the magnet dn value or uploaded torrent/NZB filename, instead of using a shorter debrid/provider title.
  • This helps avoid imports where the ARR selected one release title but later sees a different folder name from Decypharr.

Example of the issue this fixes:

Sonarr selected/scored the full release title:

Sonarr search result showing the full release title

Real-Debrid later exposed a shorter/different torrent name:

Real-Debrid showing a shorter torrent name

With ARR submitted name, Decypharr creates the folder using the title ARR originally submitted:

Folder using the ARR-submitted release name

That lets Sonarr import the same release successfully instead of rejecting it based on the shortened folder name:

Successful Sonarr import

Target Branch Check (IMPORTANT)

  • I confirm this PR is targeting the correct branch

Expected target:

  • beta (for features)

Changes Made

  • Added folder_naming: "arr_submitted_name" and the ARR submitted name settings option.
  • Uses the submitted magnet display name (dn) when available.
  • Uses uploaded torrent filenames for .torrent uploads. Sonarr/Radarr submit torrent files using the cleaned release title as the multipart filename, so this matches the title used for detection/scoring. .magnet files preserve embedded display names and fall back to the uploaded .magnet filename when no display name is present.
  • Sanitizes generated folder names and falls back to the infohash when the submitted name cannot produce a safe folder name.
  • Updates qBittorrent-compatible name and content_path values so ARR clients see the folder Decypharr actually creates.
  • Updated WebDAV folder naming docs, including the current global config key: folder_naming.
  • Added tests for magnet display names, uploaded torrent filenames, unsafe names, and fallback behavior.

Testing

  • Tested locally

Steps:

  1. Captured Sonarr -> Decypharr requests and confirmed the ARR-submitted name contained the full release title.
  2. Checked Sonarr logs for the failed import case. Example:
    • Short folder parsed badly:
      Parsing string 'Season 01 1080p WEB-DL x265'
      No matching series Season
    • Full ARR-selected title parsed correctly:
      Parsing string 'Example Show Season 01 S01 1080p WEB-DL x265'
      Episode Parsed. Example Show - Season 01
    • Import later rejected files against the shortened folder:
      Episode 01x03 was unexpected considering the Season 01 1080p WEB-DL x265 folder name
      Not all episodes have been imported for the release 'Season 01 1080p WEB-DL x265'
  3. Verified the new option uses the original ARR-submitted release name, for example Example Show Season 01 S01 1080p WEB-DL x265.
  4. Ran targeted tests:
go test ./internal/utils ./pkg/storage ./pkg/server/qbit

Risks / Notes

  • Existing folder naming options are unchanged.
  • The docs previously referenced webdav_folder_naming, but the current global config key is folder_naming; this PR only updates the docs to match existing config behavior.
  • Unsafe folder names are sanitized before use:
    • removes invalid/control characters and path separators
    • trims unsafe leading/trailing spaces or dots
    • rejects reserved names like CON, NUL, COM1, etc.
    • truncates very long names
    • falls back to the infohash if the result is empty or still unsafe

Screenshots (if applicable)

  • Settings dropdown now includes ARR submitted name as a folder naming option.
    image

Checklist

  • Code builds successfully
  • No console/log errors
  • Reviewed my own code
  • Target branch is correct

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.

1 participant