Skip to content

Commit 99bcb9f

Browse files
committed
fix: api get traffic/details json parse
1 parent 5f28607 commit 99bcb9f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

realdebrid/api_traffic.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ type TrafficDetails = map[string]struct {
3232
}
3333

3434
// GetTrafficDetails retrieves detailed traffic information on each hoster during a specified period.
35-
// The `start` and `end` parameters should be in ISO 8601 format (e.g., "2023-01-01T00:00:00Z").
35+
// The `start` and `end` parameters should be in ISO 8601 format (e.g., "2023-01-01").
36+
// Note: Currently returns empty [], to be fixed later on.
3637
// `GET /traffic/details`
37-
func (c *RealDebridClient) GetTrafficDetails(start string, end string) (*TrafficDetails, error) {
38-
var trd TrafficDetails
38+
func (c *RealDebridClient) GetTrafficDetails(start string, end string) ([]TrafficDetails, error) {
39+
var trd []TrafficDetails
3940
resp, err := c.client.R().SetSuccessResult(&trd).SetQueryParam("start", start).SetQueryParam("end", end).Get("traffic/details")
4041
if err != nil {
4142
return nil, err
@@ -45,5 +46,5 @@ func (c *RealDebridClient) GetTrafficDetails(start string, end string) (*Traffic
4546
return nil, resp.Err
4647
}
4748

48-
return &trd, nil
49+
return trd, nil
4950
}

0 commit comments

Comments
 (0)