Allow detection of waiting_file_selection

This commit is contained in:
Ben Sarmiento
2023-12-09 00:50:42 +01:00
parent 4dcd2e64bb
commit 2281b58b59
9 changed files with 115 additions and 87 deletions

View File

@@ -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()

View File

@@ -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:"-"`
}