assigned links

This commit is contained in:
Ben Sarmiento
2024-01-12 01:12:34 +01:00
parent cc37a92d75
commit ebab40d3e6
7 changed files with 71 additions and 57 deletions

View File

@@ -185,7 +185,7 @@ func (t *TorrentManager) GetKey(torrent *Torrent) string {
}
}
func (t *TorrentManager) writeTorrentToFile(instanceID string, torrent *Torrent, overwriteNames bool) {
func (t *TorrentManager) writeTorrentToFile(instanceID string, torrent *Torrent) {
filePath := "data/" + instanceID + ".json"
file, err := os.Create(filePath)
if err != nil {
@@ -194,13 +194,6 @@ func (t *TorrentManager) writeTorrentToFile(instanceID string, torrent *Torrent,
}
defer file.Close()
if !overwriteNames {
infoCache, _ := t.DirectoryMap.Get(INT_INFO_CACHE)
if cachedTorrent, exists := infoCache.Get(instanceID); exists {
torrent.Name = cachedTorrent.Name
torrent.OriginalName = cachedTorrent.OriginalName
}
}
torrent.Version = t.requiredVersion
jsonData, err := json.Marshal(torrent)