Much more stringent check
This commit is contained in:
@@ -82,6 +82,13 @@ type TorrentInfo struct {
|
||||
Files []File `json:"files"`
|
||||
}
|
||||
|
||||
func (i *TorrentInfo) IsDone() bool {
|
||||
if i.Progress != 100 {
|
||||
return false
|
||||
}
|
||||
return len(i.Files) == len(i.Links) && len(i.Files) > 0
|
||||
}
|
||||
|
||||
func (i *TorrentInfo) MarshalJSON() ([]byte, error) {
|
||||
type Alias TorrentInfo
|
||||
aux := &struct {
|
||||
|
||||
Reference in New Issue
Block a user