assigned links
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user