Add setting for hiding broken torrents
This commit is contained in:
@@ -220,7 +220,7 @@ func (hs *Handlers) handleInfuseTorrentsList(resp http.ResponseWriter, req *http
|
||||
|
||||
// handle files list request
|
||||
|
||||
func (hs *Handlers) innerFilesListHandler(resp http.ResponseWriter, req *http.Request, handleFunc func(string, string, *torrent.TorrentManager) ([]byte, error), contentType string) {
|
||||
func (hs *Handlers) innerFilesListHandler(resp http.ResponseWriter, req *http.Request, handleFunc func(string, string, *torrent.TorrentManager, bool) ([]byte, error), contentType string) {
|
||||
directory, err := url.PathUnescape(chi.URLParam(req, "directory"))
|
||||
if err != nil {
|
||||
directory = chi.URLParam(req, "directory")
|
||||
@@ -229,7 +229,7 @@ func (hs *Handlers) innerFilesListHandler(resp http.ResponseWriter, req *http.Re
|
||||
if err != nil {
|
||||
torrentName = chi.URLParam(req, "torrent")
|
||||
}
|
||||
out, err := handleFunc(directory, torrentName, hs.torMgr)
|
||||
out, err := handleFunc(directory, torrentName, hs.torMgr, hs.cfg.ShouldHideBrokenTorrents())
|
||||
if err != nil && strings.Contains(contentType, "xml") {
|
||||
hs.log.Debugf("Not implemented: %s %s", req.Method, req.URL)
|
||||
resp.WriteHeader(http.StatusNotImplemented)
|
||||
|
||||
Reference in New Issue
Block a user