@@ -176,7 +176,7 @@ type Torrent struct {
176
176
RecheckProgress * float64 `json:"recheckProgress"`
177
177
TimeDownloading * time.Duration `json:"-"` // from secondsDownloading
178
178
TimeSeeding * time.Duration `json:"-"` // from secondsSeeding
179
- SeedIdleLimit * int64 `json:"seedIdleLimit "`
179
+ SeedIdleLimit * time. Duration `json:"- "`
180
180
SeedIdleMode * int64 `json:"seedIdleMode"`
181
181
SeedRatioLimit * float64 `json:"seedRatioLimit"`
182
182
SeedRatioMode * SeedRatioMode `json:"seedRatioMode"`
@@ -226,6 +226,7 @@ func (t *Torrent) UnmarshalJSON(data []byte) (err error) {
226
226
PieceSize * int64 `json:"pieceSize"`
227
227
SecondsDownloading * int64 `json:"secondsDownloading"`
228
228
SecondsSeeding * int64 `json:"secondsSeeding"`
229
+ SeedIdleLimit * int64 `json:"seedIdleLimit"`
229
230
SizeWhenDone * int64 `json:"sizeWhenDone"`
230
231
StartDate * int64 `json:"startDate"`
231
232
TotalSize * int64 `json:"totalSize"`
@@ -271,6 +272,10 @@ func (t *Torrent) UnmarshalJSON(data []byte) (err error) {
271
272
dur := time .Duration (* tmp .SecondsSeeding ) * time .Second
272
273
t .TimeSeeding = & dur
273
274
}
275
+ if tmp .SeedIdleLimit != nil {
276
+ dur := time .Duration (* tmp .SeedIdleLimit ) * time .Minute
277
+ t .SeedIdleLimit = & dur
278
+ }
274
279
if tmp .SizeWhenDone != nil {
275
280
swd := cunits .ImportInByte (float64 (* tmp .SizeWhenDone ))
276
281
t .SizeWhenDone = & swd
@@ -308,6 +313,7 @@ func (t Torrent) MarshalJSON() (data []byte, err error) {
308
313
DoneDate * int64 `json:"doneDate"`
309
314
SecondsDownloading * int64 `json:"secondsDownloading"`
310
315
SecondsSeeding * int64 `json:"secondsSeeding"`
316
+ SeedIdleLimit * int64 `json:"seedIdleLimit"`
311
317
StartDate * int64 `json:"startDate"`
312
318
Wanted []int64 `json:"wanted"` // boolean in number form
313
319
* RawTorrent
@@ -339,6 +345,10 @@ func (t Torrent) MarshalJSON() (data []byte, err error) {
339
345
ss := int64 (* t .TimeSeeding / time .Second )
340
346
tmp .SecondsSeeding = & ss
341
347
}
348
+ if t .SeedIdleLimit != nil {
349
+ sil := int64 (* t .SeedIdleLimit / time .Minute )
350
+ tmp .SeedIdleLimit = & sil
351
+ }
342
352
if t .StartDate != nil {
343
353
st := t .StartDate .Unix ()
344
354
tmp .StartDate = & st
0 commit comments