Update hook passing paths now
This commit is contained in:
@@ -25,12 +25,14 @@ type Torrent struct {
|
||||
Name string `json:"filename"`
|
||||
Progress int `json:"-"`
|
||||
Links []string `json:"links"`
|
||||
Added string `json:"-"`
|
||||
}
|
||||
|
||||
func (i *Torrent) UnmarshalJSON(data []byte) error {
|
||||
type Alias Torrent
|
||||
aux := &struct {
|
||||
Progress float64 `json:"progress"`
|
||||
Added string `json:"added"`
|
||||
*Alias
|
||||
}{
|
||||
Alias: (*Alias)(i),
|
||||
@@ -41,6 +43,9 @@ func (i *Torrent) UnmarshalJSON(data []byte) error {
|
||||
}
|
||||
|
||||
i.Progress = int(math.Round(aux.Progress))
|
||||
|
||||
i.Added = strings.Replace(aux.Added, "Z", "+01:00", 1)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user