Fix http mount issues
This commit is contained in:
@@ -100,8 +100,15 @@ func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
buf.WriteString("<ol>")
|
||||
for _, download := range torMgr.DownloadCache.Items() {
|
||||
buf.WriteString(fmt.Sprintf("<li><a href=\"%s\">%s</a></li>", download.Download, download.Filename))
|
||||
filenames := torMgr.DownloadMap.Keys()
|
||||
sort.Strings(filenames)
|
||||
for _, filename := range filenames {
|
||||
download, ok := torMgr.DownloadMap.Get(filename)
|
||||
if !ok || !strings.HasPrefix(download.Link, "http") {
|
||||
continue
|
||||
}
|
||||
filePath := filepath.Join(config.DOWNLOADS, url.PathEscape(filename))
|
||||
buf.WriteString(fmt.Sprintf("<li><a href=\"/http/%s\">%s</a></li>", filePath, download.Filename))
|
||||
}
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user