Assign to directories
This commit is contained in:
@@ -36,7 +36,14 @@ func (t *TorrentManager) refreshTorrents() []string {
|
||||
t.getTorrentFiles("data").Each(func(filePath string) bool {
|
||||
torrent := t.readTorrentFromFile(filePath)
|
||||
if torrent != nil {
|
||||
allTorrents.Set(t.GetKey(torrent), torrent)
|
||||
accessKey := t.GetKey(torrent)
|
||||
allTorrents.Set(accessKey, torrent)
|
||||
t.assignDirectory(torrent, func(directory string) {
|
||||
listing, _ := t.DirectoryMap.Get(directory)
|
||||
listing.Set(accessKey, torrent)
|
||||
|
||||
updatedPaths.Add(fmt.Sprintf("%s/%s", directory, accessKey))
|
||||
})
|
||||
filename := filepath.Base(filePath)
|
||||
cachedAccessKeys.Add(strings.TrimSuffix(filename, ".zurgtorrent"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user