Handle adds and deletes

This commit is contained in:
Ben Sarmiento
2023-12-06 02:02:01 +01:00
parent 4b8fd82acd
commit 0e471ba42d
5 changed files with 41 additions and 28 deletions

View File

@@ -10,9 +10,9 @@ import (
"go.uber.org/zap"
)
func HandleHeadRequest(directory, torrentName, fileName string, w http.ResponseWriter, req *http.Request, t *torrent.TorrentManager, log *zap.SugaredLogger) {
func HandleHeadRequest(directory, torrentName, fileName string, w http.ResponseWriter, req *http.Request, torMgr *torrent.TorrentManager, log *zap.SugaredLogger) {
torrents, ok := t.DirectoryMap.Get(directory)
torrents, ok := torMgr.DirectoryMap.Get(directory)
if !ok {
log.Warnf("Cannot find directory %s", directory)
http.Error(w, "File not found", http.StatusNotFound)