This commit is contained in:
Ben Sarmiento
2024-05-23 19:29:16 +02:00
parent 2a5f12e37f
commit d03b59bb2a
10 changed files with 275 additions and 226 deletions

View File

@@ -168,7 +168,7 @@ func (t *TorrentManager) writeTorrentToFile(torrent *Torrent) {
return
}
t.log.Debugf("Saved torrent %s to file", torrent.Hash)
t.log.Debugf("Saved torrent %s (hash=%s) to file", t.GetKey(torrent), torrent.Hash)
}
func (t *TorrentManager) readTorrentFromFile(hash string) *Torrent {
@@ -189,9 +189,6 @@ func (t *TorrentManager) readTorrentFromFile(hash string) *Torrent {
if err := json.Unmarshal(jsonData, &torrent); err != nil {
return nil
}
if len(torrent.Components) == 0 {
t.log.Fatal("Torrent has no downloaded or in progress ids")
}
if torrent.Version != t.requiredVersion {
return nil
}