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