feat(torrent): add magnet and torrent handoff

This commit is contained in:
NimBold
2026-08-07 18:39:24 +03:30
parent 27da8b1c44
commit 27ac8d9083
11 changed files with 461 additions and 40 deletions
+23
View File
@@ -120,6 +120,29 @@ describe('add download metadata workflow', () => {
});
});
it('preserves an explicit torrent handoff for an opaque remote URL', () => {
const sourceUrl = 'https://example.com/download?id=opaque';
const rows = reconcileDownloadRows(
sourceUrl,
[],
'example.torrent',
new Set(),
undefined,
{},
{},
{},
{},
new Set([sourceUrl])
);
expect(rows[0]).toMatchObject({
sourceUrl,
isTorrent: true,
torrentCacheId: `${rows[0].id}-1`,
file: 'example.torrent'
});
});
it('gives refreshed torrent metadata a new cache identity', () => {
const existing = row({
id: 'torrent-row',