feat: seed downloads by default (opt-out) with robust resume and clean quit

Finished downloads now keep seeding automatically and you opt out per item with
p, reusing the live torrent instead of tearing it down. Resume and restore seed
from the .torrent metadata captured at download time, so they verify the local
file immediately rather than depending on re-fetching metadata from the swarm.

Quitting now flushes queue, history, and seeds synchronously and exits
immediately, fixing the hang when quitting while seeding or with a paused seed.
Paused seeds persist their state and stay paused across restarts. Hide the
hardware cursor on the splash, and clarify that c removes a finished item the
same way in Downloads and Seeding.

Tests are isolated from the real data dir via a TORLINK_STATE_DIR override plus
vitest config, so runs never touch user data. Adds scripts/verify-seeding.ts
(npm run verify:seeding), an offline-deterministic harness proving seed, pause,
and resume transfer real bytes.
This commit is contained in:
bairon.dev
2026-06-27 17:02:22 -04:00
parent 8a9886be9c
commit 14b4a5ede6
22 changed files with 1002 additions and 64 deletions
+1
View File
@@ -19,6 +19,7 @@
"start": "node dist/index.js",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"verify:seeding": "tsx scripts/verify-seeding.ts",
"previews": "tsx scripts/render-previews.tsx",
"prepublishOnly": "npm run build"
},