Magnetarr
A single-binary Rust media manager that searches many indexers at once and files downloads into Plex.
Running on the home server
Description
Running a media library by hand means searching each indexer separately, comparing what comes back, and moving finished downloads into place afterwards. The usual answer is a stack of separate services, one per media type, each with its own configuration. I wanted one binary that covered movies, TV and anime, with a desktop window and a command line over the same core. I run it every day, so the failures it guards against are ones I have hit.
Block diagram
- Indexers
- magnetarr-core
- qBittorrent
- Verify + move
- Plex library
Decisions
One indexer trait, native ports and definitions behind it
Native ports and Cardigann-defined indexers answer the same trait and are searched concurrently. The pinned upstream Cardigann catalogue is embedded in the binary and executed directly, so no site carries a second implementation. A definition the runtime cannot execute is rejected at load with every reason listed, and the GUI shows it blocked with that reason, because the alternative is an empty result set that reads as nothing matched.
An add counts only when qBittorrent's reply proves it
qBittorrent accepts a link it has only queued for a background fetch, and that reply looks the same whether or not the fetch will ever work. Magnetarr downloads the torrent file itself and uploads the bytes, so qBittorrent parses the torrent before it answers. The add is confirmed from the reply body, and anything else surfaces as a failure naming what qBittorrent said.
An import touches only its own torrent's files
Import planning used to scan the download folder recursively, and two torrents can share one folder; one import moved and damaged a second torrent's episodes that way. Since 0.6.7 the torrent is stopped before any file moves, and the plan uses only the files that torrent declares to qBittorrent. The cost is that an import now depends on qBittorrent answering, and fails at Verify when it does not.
Errata
- When an import fails at Verify, the error appears in the GUI only; the log gets no line for it.
- An extras file whose two-word keyword is joined by dots, such as Deleted.Scenes, is not recognised as an extra.
Revision history
| Version | Changes |
|---|---|
| 0.6.8 | Extras that repeat a file name across a pack's folders take the folder as a suffix; an episode title holding an extras keyword stays an episode. |
| 0.6.7 | A torrent is stopped before its files move, and an import plans only the files its own torrent declares. |
| 0.6.6 | Added an About page and moved indexer management to its own Indexers page. |
| 0.6.5 | Pack parsing reads long-form episode names, year ranges and absolute numbers. |