Minor bug fixes
This commit is contained in:
+1
-2
@@ -46,8 +46,7 @@ func (q *QBit) CategoryContext(next http.Handler) http.Handler {
|
||||
category = r.FormValue("category")
|
||||
}
|
||||
}
|
||||
ctx := r.Context()
|
||||
ctx = context.WithValue(r.Context(), "category", strings.TrimSpace(category))
|
||||
ctx := context.WithValue(r.Context(), "category", strings.TrimSpace(category))
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
})
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ type QBit struct {
|
||||
DownloadFolder string `json:"download_folder"`
|
||||
Categories []string `json:"categories"`
|
||||
Storage *TorrentStorage
|
||||
debug bool
|
||||
logger zerolog.Logger
|
||||
Tags []string
|
||||
RefreshInterval int
|
||||
|
||||
+1
-5
@@ -169,14 +169,10 @@ func (q *QBit) UpdateTorrentMin(t *Torrent, debridTorrent *debrid.Torrent) *Torr
|
||||
}
|
||||
|
||||
func (q *QBit) UpdateTorrent(t *Torrent, debridTorrent *debrid.Torrent) *Torrent {
|
||||
_db := service.GetDebrid().GetByName(debridTorrent.Debrid)
|
||||
if debridTorrent == nil && t.ID != "" {
|
||||
debridTorrent, _ = _db.GetTorrent(t.ID)
|
||||
}
|
||||
if debridTorrent == nil {
|
||||
q.logger.Info().Msgf("Torrent with ID %s not found in %s", t.ID, _db.GetName())
|
||||
return t
|
||||
}
|
||||
_db := service.GetDebrid().GetByName(debridTorrent.Debrid)
|
||||
if debridTorrent.Status != "downloaded" {
|
||||
debridTorrent, _ = _db.GetTorrent(t.ID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user