Big commit

This commit is contained in:
Ben Sarmiento
2023-10-24 22:14:04 +02:00
parent 91472334b9
commit 2ce8273779
8 changed files with 105 additions and 71 deletions

View File

@@ -2,6 +2,7 @@ package http
import (
"fmt"
"net/url"
"path/filepath"
"github.com/debridmediamanager.com/zurg/internal/torrent"
@@ -23,7 +24,7 @@ func createMultiTorrentResponse(basePath string, torrents []torrent.Torrent) (st
}
seen[item.Name] = true
path := filepath.Join(basePath, item.Name)
path := filepath.Join(basePath, url.PathEscape(item.Name))
htmlDoc += fmt.Sprintf("<li><a href=\"%s/\">%s</a></li>", path, item.Name)
}
@@ -59,7 +60,7 @@ func createSingleTorrentResponse(basePath string, torrents []torrent.Torrent) (s
}
finalName[filename] = true
filePath := filepath.Join(currentPath, filename)
filePath := filepath.Join(currentPath, url.PathEscape(filename))
htmlDoc += fmt.Sprintf("<li><a href=\"%s\">%s</a></li>", filePath, filename)
}
}