Remove unnecessary configs

This commit is contained in:
Ben Sarmiento
2023-12-02 20:17:58 +01:00
parent 1d5f7fb1b6
commit e4bdecd979
2 changed files with 11 additions and 29 deletions

View File

@@ -155,23 +155,23 @@ func (t *TorrentManager) RefreshTorrents() {
}
t.log.Infof("Compiled into %d torrents, %d were missing info", oldTorrents.Count(), noInfoCount)
somthingChanged := false
somethingChanged := false
// removed
strset.Difference(t.accessKeySet, freshKeys).Each(func(accessKey string) bool {
somthingChanged = true
somethingChanged = true
t.Delete(accessKey, false, false)
return true
})
// new
strset.Difference(freshKeys, t.accessKeySet).Each(func(accessKey string) bool {
somthingChanged = true
somethingChanged = true
torrent, _ := oldTorrents.Get(accessKey)
t.UpdateTorrentResponseCache(torrent)
t.accessKeySet.Add(accessKey)
return true
})
// now we can build the directory responses
if somthingChanged {
if somethingChanged {
t.UpdateDirectoryResponsesCache()
}