Remove tests

This commit is contained in:
Ben Sarmiento
2023-10-24 22:19:43 +02:00
parent 2ce8273779
commit 37cd84d07b
2 changed files with 8 additions and 17 deletions

View File

@@ -60,7 +60,7 @@ func HandleHeadRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torren
return
}
if file.Link == "" {
log.Println("Link not found 222", filename)
log.Println("Link not found (head)", filename)
http.Error(w, "Cannot find file", http.StatusNotFound)
return
}
@@ -131,7 +131,7 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torrent
return
}
if file.Link == "" {
log.Println("Link not found 33", filename)
log.Println("Link not found (get)", filename)
http.Error(w, "Cannot find file", http.StatusNotFound)
return
}
@@ -165,10 +165,6 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torrent
func getFile(torrents []torrent.Torrent, filename, fragment string) (*torrent.Torrent, *torrent.File) {
for t := range torrents {
for f, file := range torrents[t].SelectedFiles {
// fmt.Println("~~~~~~~~~~~~~~", torrents[t].Version)
if torrents[t].ID == "ABUNEKZP3UPMU" || torrents[t].ID == "TAA5WUJ6BVEAE" {
fmt.Println("~~~~~~~~~~~~~~", torrents[t].ID, torrents[t].Version, len(torrents[t].Links), len(file.Link))
}
fname := filepath.Base(file.Path)
if filename == fname && strings.Contains(file.Link, fragment) {
return &torrents[t], &torrents[t].SelectedFiles[f]