Clone set before modifying

This commit is contained in:
Ben Sarmiento
2024-05-27 17:17:45 +02:00
parent f28255a142
commit 964fdfcbf9
5 changed files with 25 additions and 14 deletions

View File

@@ -46,7 +46,8 @@ type TorrentManager struct {
DumpTrigger chan struct{}
AnalyzeTrigger chan struct{}
latestState *LibraryState
latestState *LibraryState
inProgressHashes mapset.Set[string]
repairTrigger chan *Torrent
repairQueue mapset.Set[*Torrent]
@@ -221,7 +222,7 @@ func (t *TorrentManager) writeTorrentToFile(torrent *Torrent) {
return
}
t.log.Debugf("Saved torrent %s to file", t.GetKey(torrent))
// t.log.Debugf("Saved torrent %s to file", t.GetKey(torrent))
}
func (t *TorrentManager) applyMediaInfoDetails(torrent *Torrent) {
@@ -269,11 +270,6 @@ func (t *TorrentManager) readTorrentFromFile(filePath string) *Torrent {
return torrent
}
func (t *TorrentManager) deleteTorrentFile(filename string) {
filePath := "data/" + filename + ".zurgtorrent"
_ = os.Remove(filePath)
}
/// end torrent functions
/// info functions