Generate preview thumbnails as soon as Sonarr or Radarr imports a file¶
In Sonarr or Radarr, add a Webhook connection that points at Media Preview Generator. Enable the import and upgrade events. When a file lands, the app waits for a quiet period (60 seconds by default), then makes previews for just those files. It publishes them to every Plex, Emby or Jellyfin server that has the file. If a server hasn't added the file to its library yet, the app retries after 1, 2 and 5 minutes by default. A higher retry count adds 15- and 60-minute steps.
Set it up¶
- In Media Preview Generator, open Automation → Triggers and copy the Radarr or Sonarr Webhook URL.
- In Radarr or Sonarr, go to Settings → Connect → + → Webhook.
- Paste the URL and enable the events:
- Radarr: On Import and On Upgrade.
- Sonarr: On File Import and On File Upgrade.
- Authentication: leave Username empty and put your API token or webhook secret in Password. If the form has a Headers section, you can use an
X-Auth-Tokenheader instead. - Click Test, then Save. The test shows up in the app's webhook activity log.
Field-by-field steps: Configure Radarr and Configure Sonarr. To use a separate secret for webhooks, see Webhook Secret.
Tip
Sonarr and Radarr often see paths differently from your media server and from this container, for example /tv/... against /data/tv/.... Fill in the webhook column of the server's path mapping so the paths line up. See the FAQ entry on the webhook path column and Path Mappings.
What the app accepts¶
- Radarr and Sonarr
Downloadevents. These cover both imports and upgrades. The file path comes from: - Radarr:
movieFile.path, ormovie.folderPathplusmovieFile.relativePath. - Sonarr:
episodeFile.path, orseries.pathplusepisodeFile.relativePath. Testevents. Logged, and nothing is processed.- Any other event type. Ignored and logged.
- Sportarr. Sonarr-compatible payloads are accepted at
/api/webhooks/sportarr. - One URL for everything.
POST /api/webhooks/incomingalso recognises Sonarr and Radarr payloads by their shape, alongside Plex, Emby, Jellyfin and plain{"path": "..."}bodies. See Webhook Endpoints. - Tdarr, FileFlows and scripts. Use the custom endpoint with
{"file_path": "..."}. This matters when a tool changes a file after import, because Sonarr and Radarr send nothing then. See Custom Webhook.
What happens after the webhook¶
- Batching. Files are queued per source. A batch runs once the delay (default 60 seconds, range 10–300) passes with no new files from that source. Each new file restarts the timer. A season pack becomes one job. See Batching and the delay.
- Finding the servers. Each path is mapped to the container's view. Then every configured server whose enabled libraries contain the file is found. A path outside every enabled library is skipped, not retried.
- One decode. FFmpeg runs once per file on a GPU worker, or on a CPU worker if you have no GPU.
- Publishing. Each server that owns the file gets its own format:
- Plex: a BIF in its data folder.
- Emby: a BIF next to the video.
- Jellyfin: trickplay tiles.
- Queue priority. New imports run at High priority by default. They overtake a running full-library scan file by file, without cancelling it (details).
Retries for files the server hasn't indexed yet¶
Sonarr and Radarr often call the webhook before your media server has scanned the new file. Plex in particular can't take a preview until its scan creates the item.
- A file that isn't in a server's library yet, or whose preview hasn't been registered yet, is retried after about 1, 2, 5, 15 and 60 minutes. That's about 83 minutes in total. After that the app gives up and logs it.
- The retries run as follow-up jobs covering only the files still waiting.
- Work already done is not repeated. A companion file records the source file's size and modification time, so files with a current preview are skipped. Frames extracted in the last hour are reused if a second trigger arrives for the same file, such as Plex's own webhook after Sonarr's. See Smart dedup.
To shorten the wait, make sure the server notices new files quickly:
- Plex: turn on the FSEvent library-update settings.
- Emby and Jellyfin: turn on real-time monitoring.
Previews Readiness checks these.
Upgrades¶
On an upgrade, Sonarr and Radarr send the new file along with the file it replaced. The app makes previews for the new file. It also removes the old file's sidecar output next to the media (the Emby BIF and the Jellyfin trickplay folder), so stale previews don't pile up.
The Plex direct webhook and the Recently Added poll only see new library items, not in-place upgrades. For upgrades, the Sonarr/Radarr webhook is the trigger that works (why).
Troubleshooting¶
- 401 from the webhook: the token is wrong or missing. Leave Username empty and put the token in Password.
- Radarr or Sonarr can't reach the URL: use the host's IP or a Docker hostname they can resolve, not
localhost. - The test works but imports do nothing: check that the import events are ticked, and that webhooks are enabled on the Automation page.
- The job sits in Pending: check that Incoming job priority is High, and that Pause Processing is off.
More in the troubleshooting table.