Mount youtube videos properly

This commit is contained in:
Ben Adrian Sarmiento
2024-06-28 22:40:39 +02:00
parent c781a5fc7c
commit 6038380d38
5 changed files with 14 additions and 7 deletions

View File

@@ -97,12 +97,8 @@ func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
filenames := torMgr.DownloadMap.Keys()
sort.Strings(filenames)
for _, filename := range filenames {
download, ok := torMgr.DownloadMap.Get(filename)
if !ok {
continue
}
filePath := filepath.Join(config.DOWNLOADS, url.PathEscape(filename))
buf.WriteString(fmt.Sprintf("<li><a href=\"/http/%s\">%s</a></li>", filePath, download.Filename))
buf.WriteString(fmt.Sprintf("<li><a href=\"/http/%s\">%s</a></li>", filePath, filename))
}
return buf.Bytes(), nil
}