Добавил реализацию

This commit is contained in:
av
2026-06-28 12:20:10 +03:00
parent 4f2fb5998a
commit d8ef7063f4
12 changed files with 731 additions and 39 deletions
+4
View File
@@ -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))