Allow detection of waiting_file_selection
This commit is contained in:
@@ -62,7 +62,7 @@ func (rd *RealDebrid) UnrestrictCheck(link string) (*Download, error) {
|
||||
|
||||
// GetTorrents returns all torrents, paginated
|
||||
// if customLimit is 0, the default limit of 1000 is used
|
||||
func (rd *RealDebrid) GetTorrents(customLimit int) ([]Torrent, int, error) {
|
||||
func (rd *RealDebrid) GetTorrents(customLimit int, active bool) ([]Torrent, int, error) {
|
||||
baseURL := "https://api.real-debrid.com/rest/1.0/torrents"
|
||||
var allTorrents []Torrent
|
||||
page := 1
|
||||
@@ -76,7 +76,9 @@ func (rd *RealDebrid) GetTorrents(customLimit int) ([]Torrent, int, error) {
|
||||
params := url.Values{}
|
||||
params.Set("page", fmt.Sprintf("%d", page))
|
||||
params.Set("limit", fmt.Sprintf("%d", limit))
|
||||
// params.Set("filter", "active")
|
||||
if active {
|
||||
params.Set("filter", "active")
|
||||
}
|
||||
|
||||
reqURL := baseURL + "?" + params.Encode()
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ type Torrent struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"filename"`
|
||||
Progress int `json:"-"`
|
||||
Status string `json:"status"`
|
||||
Links []string `json:"links"`
|
||||
Added string `json:"-"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user