Refactors

This commit is contained in:
Ben Adrian Sarmiento
2024-07-11 22:13:34 +02:00
parent d8e6b2523b
commit 4aafe5b4fc
6 changed files with 18 additions and 48 deletions

View File

@@ -31,7 +31,7 @@ func ServeRootDirectory(torMgr *torrent.TorrentManager) ([]byte, error) {
return buf.Bytes(), nil
}
func ServeTorrentsList(directory string, torMgr *torrent.TorrentManager) ([]byte, error) {
func ServeGroupDirectory(directory string, torMgr *torrent.TorrentManager) ([]byte, error) {
torrents, ok := torMgr.DirectoryMap.Get(directory)
if !ok {
return nil, fmt.Errorf("cannot find directory %s", directory)
@@ -94,7 +94,7 @@ func ServeFilesList(directory, torrentName string, torMgr *torrent.TorrentManage
return buf.Bytes(), nil
}
func ServeDownloadsList(torMgr *torrent.TorrentManager) ([]byte, error) {
func ServeDownloadsList(_ string, torMgr *torrent.TorrentManager) ([]byte, error) {
var buf bytes.Buffer
buf.WriteString("<ol>")
filenames := torMgr.DownloadMap.Keys()