Fixers and repairs

This commit is contained in:
Ben Sarmiento
2024-01-19 03:02:21 +01:00
parent c0b9fc8c55
commit 7b1e34c705
4 changed files with 35 additions and 17 deletions

View File

@@ -50,6 +50,10 @@ type Torrent struct {
Added string `json:"-"`
}
func (i *Torrent) IsDone() bool {
return i.Progress == 100 && len(i.Links) > 0
}
func (i *Torrent) UnmarshalJSON(data []byte) error {
type Alias Torrent
aux := &struct {