Naut/plugins
ookami125 f4f4e86be4 webui: fix add-torrent crash, add categories/tags, real names
The daemon segfaulted the moment any torrent existed: map_torrent built
its JSON with one 30-key json_pack whose format string had drifted out of
sync with the argument list, so json_pack misread an int as a char* and
crashed in the next snapshot build (an empty fleet hid it). Rebuild the
object field-by-field with json_object_set_new so it can't drift again.

Add a web-layer category/tag store (in memory, like qBittorrent's own Web
API) so the UI can actually create categories and tags and assign them:
- /api/categories[/delete] and /api/tags[/delete] persist and return them
- /api/meta returns the stored categories/tags
- /api/action handles setCategory/addTags/removeTags (still 501 for
  engine-level verbs the daemon can't do)
- map_torrent fills each torrent's category/tags from the store

Uploaded torrents kept their temp upload path as the display name; keep
the name the UI sends at add time and prefer it in the grid.

Fix a use-after-free in api_action that read the action string after
freeing the request, which corrupted the error body into a 500.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 00:43:26 -04:00
..
example Initial commit: Naut-Torrent — from-scratch 10 GbE BitTorrent client 2026-06-15 12:12:00 -04:00
webui webui: fix add-torrent crash, add categories/tags, real names 2026-06-17 00:43:26 -04:00