Accommodate for empty RD accounts
This commit is contained in:
@@ -95,6 +95,10 @@ func (rd *RealDebrid) GetTorrents(customLimit int, active bool) ([]Torrent, int,
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode == http.StatusNoContent {
|
||||
return allTorrents, 0, nil
|
||||
}
|
||||
|
||||
// if status code is not 2xx, return erro
|
||||
|
||||
var torrents []Torrent
|
||||
@@ -340,6 +344,10 @@ func (rd *RealDebrid) GetDownloads(page, offset int) ([]Download, int, error) {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode == http.StatusNoContent {
|
||||
return allDownloads, 0, nil
|
||||
}
|
||||
|
||||
// if status code is not 2xx, return erro
|
||||
|
||||
var downloads []Download
|
||||
|
||||
Reference in New Issue
Block a user