Change defaults and modify dumped torrents behavior
This commit is contained in:
@@ -36,13 +36,15 @@ func (t *TorrentManager) refreshTorrents() []string {
|
||||
torrent := t.readTorrentFromFile(filePath)
|
||||
if torrent != nil {
|
||||
accessKey := t.GetKey(torrent)
|
||||
t.log.Debugf("Adding dumped torrent %s", accessKey)
|
||||
allTorrents.Set(accessKey, torrent)
|
||||
t.assignDirectory(torrent, func(directory string) {
|
||||
listing, _ := t.DirectoryMap.Get(directory)
|
||||
listing.Set(accessKey, torrent)
|
||||
// note that we're not adding it to updatedPaths
|
||||
})
|
||||
if !allTorrents.Has(accessKey) {
|
||||
t.log.Debugf("Loading dumped torrent %s", accessKey)
|
||||
allTorrents.Set(accessKey, torrent)
|
||||
t.assignDirectory(torrent, func(directory string) {
|
||||
listing, _ := t.DirectoryMap.Get(directory)
|
||||
listing.Set(accessKey, torrent)
|
||||
// note that we're not adding it to updatedPaths
|
||||
})
|
||||
}
|
||||
freshAccessKeys.Add(accessKey) // to prevent being deleted
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user