Refactor torrent manager
This commit is contained in:
@@ -20,16 +20,28 @@ type UnrestrictResponse struct {
|
||||
}
|
||||
|
||||
type Torrent struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"filename"`
|
||||
Hash string `json:"hash"`
|
||||
Progress int `json:"-"`
|
||||
Added string `json:"added"`
|
||||
Bytes int64 `json:"bytes"`
|
||||
Links []string `json:"links"`
|
||||
}
|
||||
|
||||
type TorrentInfo struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"filename"`
|
||||
OriginalName string `json:"original_filename"`
|
||||
Hash string `json:"hash"`
|
||||
Progress int `json:"-"`
|
||||
Added string `json:"added"`
|
||||
Bytes int64 `json:"bytes"`
|
||||
OriginalBytes int64 `json:"original_bytes"`
|
||||
Links []string `json:"links"`
|
||||
Files []File `json:"files,omitempty"`
|
||||
OriginalName string `json:"original_filename"` // from info
|
||||
OriginalBytes int64 `json:"original_bytes"` // from info
|
||||
Files []File `json:"files"` // from info
|
||||
ForRepair bool `json:"-"`
|
||||
Version string `json:"-"`
|
||||
}
|
||||
|
||||
func (t *Torrent) UnmarshalJSON(data []byte) error {
|
||||
|
||||
Reference in New Issue
Block a user