Resolve infuse routing issues

This commit is contained in:
Ben Sarmiento
2024-01-20 14:51:16 +01:00
parent 14f6169601
commit a6b02ba74e
5 changed files with 57 additions and 38 deletions

View File

@@ -87,10 +87,16 @@ type TorrentInfo struct {
}
func (i *TorrentInfo) IsDone() bool {
selectedCount := 0
for _, file := range i.Files {
if file.Selected == 1 {
selectedCount++
}
}
if i.Progress != 100 {
return false
}
return len(i.Files) == len(i.Links) && len(i.Files) > 0
return selectedCount == len(i.Links) && len(i.Links) > 0
}
func (i *TorrentInfo) MarshalJSON() ([]byte, error) {