Create a torrentMap

This commit is contained in:
Ben Sarmiento
2023-11-08 20:20:52 +01:00
parent 17cd7ae1f4
commit 9dfd6c32d5
16 changed files with 405 additions and 324 deletions

View File

@@ -18,13 +18,13 @@ func createMultiTorrentResponse(basePath string, torrents []torrent.Torrent) (st
if item.Progress != 100 {
continue
}
if _, exists := seen[item.Name]; exists {
if _, exists := seen[item.AccessKey]; exists {
continue
}
seen[item.Name] = true
seen[item.AccessKey] = true
path := filepath.Join(basePath, url.PathEscape(item.Name))
htmlDoc += fmt.Sprintf("<li><a href=\"%s/\">%s</a></li>", path, item.Name)
path := filepath.Join(basePath, url.PathEscape(item.AccessKey))
htmlDoc += fmt.Sprintf("<li><a href=\"%s/\">%s</a></li>", path, item.AccessKey)
}
return htmlDoc, nil