Serve downloads list
This commit is contained in:
@@ -22,6 +22,22 @@ type Download struct {
|
||||
Host string `json:"host"` // Host main domain
|
||||
Download string `json:"download"` // Generated link
|
||||
Streamable int `json:"streamable"`
|
||||
Generated string `json:"-"` // jsonDate
|
||||
}
|
||||
|
||||
func (d *Download) UnmarshalJSON(data []byte) error {
|
||||
type Alias Download
|
||||
aux := &struct {
|
||||
Generated string `json:"generated"`
|
||||
*Alias
|
||||
}{
|
||||
Alias: (*Alias)(d),
|
||||
}
|
||||
if err := json.Unmarshal(data, &aux); err != nil {
|
||||
return err
|
||||
}
|
||||
d.Generated = strings.Replace(aux.Generated, "Z", "+01:00", 1)
|
||||
return nil
|
||||
}
|
||||
|
||||
type Torrent struct {
|
||||
|
||||
Reference in New Issue
Block a user