Changelog 0.3.1

This commit is contained in:
Mukhtar Akere
2024-12-18 16:51:00 +01:00
parent dd0b7efdff
commit abc86a0460
12 changed files with 65 additions and 45 deletions

View File

@@ -50,7 +50,6 @@ func (s *Server) handleTorrentsAdd(w http.ResponseWriter, r *http.Request) {
}
ctx = context.WithValue(ctx, "isSymlink", isSymlink)
for _, url := range urlList {
if err := s.qbit.AddMagnet(ctx, url, category); err != nil {
s.logger.Printf("Error adding magnet: %v\n", err)
@@ -59,13 +58,8 @@ func (s *Server) handleTorrentsAdd(w http.ResponseWriter, r *http.Request) {
}
}
if contentType == "multipart/form-data" {
if contentType == "multipart/form-data" && len(r.MultipartForm.File["torrents"]) > 0 {
files := r.MultipartForm.File["torrents"]
if len(files) == 0 {
s.logger.Printf("No files provided\n")
http.Error(w, "No files provided", http.StatusBadRequest)
return
}
for _, fileHeader := range files {
if err := s.qbit.AddTorrent(ctx, fileHeader, category); err != nil {
s.logger.Printf("Error adding torrent: %v\n", err)