Skip to content

How It Works ​

Event flow ​

┌──────────┐    webhook     ┌──────────────┐    ffprobe    ┌─────────┐
│ Radarr/  │ ──────────────►│              │ ─────────────►│ media   │
│ Sonarr   │    POST        │ multilinguarr│               │ file    │
└──────────┘    /webhook/   │              │◄──────────────│         │
                radarr-fr   │              │  audio tracks │         │
                            │              │               └─────────┘
                            │              │
                            │   ┌──────────┤
                            │   │ SQLite   │  job queue +
                            │   │ database │  config store
                            │   └──────────┤
                            │              │
                            │              │── symlink ──► library/movies/fr/
                            │              │── symlink ──► library/movies/en/
                            └──────────────┘

Step by step ​

  1. Webhook received — Radarr or Sonarr sends a POST to /webhook/{instance} when a file is downloaded, upgraded, or deleted
  2. Job enqueued — the webhook payload is stored in SQLite and acknowledged immediately (200 OK with job ID)
  3. Worker claims job — a background worker picks up the job from the queue
  4. ffprobe detection — the handler runs ffprobe on the file path from the webhook payload to detect audio languages
    • The same probe reads the HEVC video header. A header with no parameter sets plays in most players but not where they are needed up front (Jellyfin direct play on Apple TV). Such a file still links; multilinguarr_hevc_empty_header_total{instance} counts it so the operator can repair or replace it.
  5. Link decision — based on detected languages and the instance config:
    • Multi-audio (e.g., FR + EN): symlinks created in both FR and EN libraries
    • Single language: symlink created in the matching library only
    • Primary single-language: the alternate instance is told to fetch its own copy (cross-instance propagation)
  6. Upgrade handling — if the webhook indicates an upgrade, old links are removed before creating new ones
  7. Delete handling — when content is deleted, corresponding links are removed from all libraries

Job queue ​

Every webhook becomes a row in the SQLite jobs table. This gives:

  • Crash recovery — if the container restarts mid-processing, pending jobs resume
  • Retry with backoff — transient failures (network, filesystem) are retried automatically
  • Audit trail — every event is recorded with its payload, status, and any errors
  • Reprocessing — POST /api/v1/jobs/reprocess re-queues every failed and dead-letter job. Completed jobs are never replayed, because the table also holds past deletes and a replayed delete cascades to the sibling instance. To re-run one completed job, use POST /api/v1/jobs/{id}/retry.

Cross-instance propagation ​

When a primary instance (e.g., Radarr-FR) imports a single-language file:

  1. multilinguarr creates a symlink in the primary library (FR)
  2. It calls the alternate instance's API (Radarr-EN) to add the same movie
  3. Radarr-EN searches for and downloads its own copy
  4. When Radarr-EN's download completes, its webhook fires and multilinguarr creates the EN library link

This ensures each instance has its own file — no shared storage between instances.

Deletes ​

An instance only deletes what lives in its own storage.

  • Primary delete. The primary's own library entry for the title goes. In every other library, the title's folder is walked entry by entry: a symlink into another instance's storage stays, along with the folder that holds it, and everything else goes. That means links into the primary's storage, links whose target is not recognised, and any regular file in the folder. A sibling that keeps its own episodes therefore keeps their links. The delete then propagates to the alternate instances, but only to a record that holds no file of its own: a Radarr movie with hasFile: false, or a Sonarr series whose statistics.episodeFileCount is 0. A sibling that holds a file keeps its record and its file, including one the add cascade asked to search. So once a sibling has downloaded, deleting the title on the primary leaves it alone, and it must be deleted on the sibling too. A Sonarr record that reports no statistics is also kept, since it cannot prove it owns nothing.
  • Alternate delete. Only the alternate's own library changes, and nothing propagates. The title's folder is walked the same way: a symlink into another instance's storage stays, whether its target is absolute or relative, because it serves that instance's file and regeneration cannot rebuild a hand-placed fallback link. Everything else goes.

Two limits apply to both kinds of delete:

  • Host paths. A link's target is compared as a path inside the container, so a link written with a host path is not recognised and goes.
  • Hardlink instances. These get no such protection, since a hardlink names no target, so every entry in the title folder goes. A sibling's files survive in its own storage.

Regeneration ​

POST /api/v1/admin/regenerate walks all storage directories, runs ffprobe on every file, and rebuilds the entire link tree. Use this:

  • After initial setup (to process existing media)
  • After a config change (new instance or language added)
  • For recovery (if links were accidentally deleted)

Add ?dry_run=true to preview what would be done without touching the filesystem.

Released under the MIT License.