Добавил реализацию
This commit is contained in:
@@ -73,6 +73,7 @@ type AddRequest struct {
|
||||
Torrents [][]byte // .torrent-файлы (Ф1 не использует)
|
||||
Category string
|
||||
SavePath string
|
||||
Rename string // отображаемое имя торрента (param rename); пустое — не задаём
|
||||
Paused bool
|
||||
}
|
||||
|
||||
@@ -173,6 +174,9 @@ func (c *Client) Add(ctx context.Context, ar AddRequest) error {
|
||||
if ar.SavePath != "" {
|
||||
_ = mw.WriteField("savepath", ar.SavePath)
|
||||
}
|
||||
if ar.Rename != "" {
|
||||
_ = mw.WriteField("rename", ar.Rename)
|
||||
}
|
||||
_ = mw.WriteField("paused", strconv.FormatBool(ar.Paused))
|
||||
for i, data := range ar.Torrents {
|
||||
fw, err := mw.CreateFormFile("torrents", fmt.Sprintf("file%d.torrent", i))
|
||||
|
||||
Reference in New Issue
Block a user