Simple string sort on listing torrents

This commit is contained in:
Ben Sarmiento
2023-12-12 00:38:17 +01:00
parent ed903c8943
commit 2a1bc59300
6 changed files with 26 additions and 28 deletions

View File

@@ -25,8 +25,8 @@ func HandleHeadRequest(directory, torrentName, fileName string, w http.ResponseW
return
}
file, _ := torrent.SelectedFiles.Get(fileName)
if file == nil {
file, ok := torrent.SelectedFiles.Get(fileName)
if !ok {
log.Warnf("Cannot find file %s from path %s", fileName, req.URL.Path)
http.Error(w, "Cannot find file", http.StatusNotFound)
return