torrent directory fix

This commit is contained in:
Ben Sarmiento
2023-11-11 13:31:24 +01:00
parent 263b0e0039
commit fef389e10d
4 changed files with 21 additions and 19 deletions

View File

@@ -180,7 +180,6 @@ func (t *TorrentManager) getChecksum() string {
}
checksum := fmt.Sprintf("%d%s%d", totalCount, torrents[0].ID, count)
t.log.Debugf("Checksum: %s", checksum)
return checksum
}
@@ -291,8 +290,9 @@ func (t *TorrentManager) getMoreInfo(rdTorrent realdebrid.Torrent) *Torrent {
continue
}
selectedFiles.Set(filepath.Base(file.Path), &File{
File: file,
Link: "", // no link yet
File: file,
Added: info.Added,
Link: "", // no link yet
})
}
if selectedFiles.Len() > len(info.Links) && info.Progress == 100 {
@@ -386,6 +386,7 @@ func (t *TorrentManager) getDirectories(torrent *realdebrid.TorrentInfo) []strin
default:
t.log.Error("Unknown config version")
}
t.log.Debugf("Torrent %s is in directories %v", t.getName(torrent.Name, torrent.OriginalName), ret)
return ret
}
@@ -478,7 +479,8 @@ func (t *TorrentManager) organizeChaos(links []string, selectedFiles *orderedmap
Bytes: result.Response.Filesize,
Selected: 1,
},
Link: result.Response.Link,
Added: time.Now().Format(time.RFC3339),
Link: result.Response.Link,
})
} else {
isChaotic = true

View File

@@ -18,5 +18,6 @@ type Torrent struct {
type File struct {
realdebrid.File
Link string
Added string
Link string
}