Commit efc4b38
committed
fix: v1.9.8 — expired torrent reimport failed for torrent-file additions
Root cause: _handle_expired_reimport only reimported if the torrent had a
magnet link stored in the DB. Torrents added via .torrent file or torrent
URL (the majority when using Sonarr/Radarr or Jackett torrent_url) were
stored with magnet=NULL. On expiry these fell into the else branch and
were marked error: "Add magnet again to retry" — no automatic re-import.
AllDebrid accepts plain hash magnets (magnet:?xt=urn:btih:<hash>) with
identical behaviour to full magnet links. The infohash is always stored
in the DB (extracted from the .torrent file or returned by AllDebrid on
upload).
Fix: if no magnet is stored, synthesize one from the infohash:
magnet:?xt=urn:btih:<hash>&dn=<url-encoded-name>
Three cases are now handled:
1. magnet stored → use it directly (existing behaviour, unchanged)
2. no magnet, hash stored (SHA-1 40 chars or SHA-256 64 chars)
→ synthesize magnet:?xt=urn:btih:<hash>&dn=<name>, reimport
3. no magnet, no hash → mark error with clear message (unchanged)
The synthesized magnet is only used for the re-upload call; it is not
written back to the DB (the original NULL is preserved).
292/292 tests passing1 parent c298ce1 commit efc4b38
2 files changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1434 | 1434 | | |
1435 | 1435 | | |
1436 | 1436 | | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
1437 | 1455 | | |
1438 | 1456 | | |
1439 | 1457 | | |
| |||
0 commit comments