Use status code constants

This commit is contained in:
Ben Adrian Sarmiento
2024-06-10 17:17:40 +02:00
parent 0fde9a6856
commit 59c15ebb0a
3 changed files with 9 additions and 8 deletions

View File

@@ -452,7 +452,7 @@ func (rd *RealDebrid) fetchPageOfDownloads(page, limit int) ([]Download, int, er
return downloads, 0, nil
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
if resp.StatusCode != http.StatusOK {
err := fmt.Errorf("unexpected status code: %d", resp.StatusCode)
rd.log.Errorf("Error when executing the get downloads request: %v", err)
return nil, 0, err