refactor: copy downloaded file according to torrent info

This commit is contained in:
Simon Ding
2025-01-31 19:34:18 +08:00
parent 1386626712
commit c01924ac3f
8 changed files with 92 additions and 35 deletions

View File

@@ -1,5 +1,7 @@
package pkg
import "io/fs"
type Torrent interface {
Name() (string, error)
Progress() (int, error)
@@ -11,10 +13,10 @@ type Torrent interface {
SeedRatio() (float64, error)
GetHash() string
//Reload() error
WalkFunc() func(fn func(path string, info fs.FileInfo) error) error
}
type Downloader interface {
GetAll() ([]Torrent, error)
Download(link, dir string) (Torrent, error)
}