Refactor torrent manager
This commit is contained in:
@@ -35,9 +35,9 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torrent
|
||||
// If there are less than 3 segments, return an error or adjust as needed
|
||||
if len(segments) <= 3 {
|
||||
if isDav {
|
||||
dav.HandlePropfindRequest(w, r, t, c, cache)
|
||||
dav.HandlePropfindRequest(w, r, t, c)
|
||||
} else {
|
||||
intHttp.HandleDirectoryListing(w, r, t, c, cache)
|
||||
intHttp.HandleDirectoryListing(w, r, t, c)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -57,7 +57,7 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torrent
|
||||
return
|
||||
}
|
||||
|
||||
torrent, file := getFile(torrents, filename)
|
||||
_, file := getFile(torrents, filename)
|
||||
if file == nil {
|
||||
log.Errorf("Cannot find file from path %s", requestPath)
|
||||
http.Error(w, "File not found", http.StatusNotFound)
|
||||
@@ -75,7 +75,7 @@ func HandleGetRequest(w http.ResponseWriter, r *http.Request, t *torrent.Torrent
|
||||
if resp == nil {
|
||||
if !file.Unavailable {
|
||||
log.Errorf("Cannot unrestrict file %s %s", filename, link)
|
||||
t.HideTheFile(torrent, file)
|
||||
// t.HideTheFile(torrent, file)
|
||||
}
|
||||
streamErrorVideo("https://www.youtube.com/watch?v=gea_FJrtFVA", w, r, t, c, log)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user