Skip internal paths

This commit is contained in:
Ben Sarmiento
2023-12-03 00:14:40 +01:00
parent 311c9c7f2e
commit f2b2d7e62e

View File

@@ -867,11 +867,16 @@ func (t *TorrentManager) UpdateTorrentResponseCache(torrent *Torrent) []string {
updatedPaths := []string{}
dav, html := t.buildTorrentResponses(torrent)
t.AssignedDirectoryCb(torrent, func(directory string) {
if strings.HasPrefix(directory, "int__") {
return
}
torrents, _ := t.DirectoryMap.Get(directory)
torrents.Set(torrent.AccessKey, torrent)
// torrent responses
pathKey := fmt.Sprintf("%s/%s", directory, torrent.AccessKey)
updatedPaths = append(updatedPaths, pathKey)
// torrent responses
newHtml := strings.ReplaceAll(html, "$dir", directory)
t.ResponseCache.Set(pathKey+".html", newHtml, 1)
newDav := strings.ReplaceAll(dav, "$dir", directory)