Skip to content

Commit

Permalink
compiles but torrent needs updating
Browse files Browse the repository at this point in the history
  • Loading branch information
jpillora committed Jan 6, 2024
1 parent 50a5ad5 commit 06f454c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 70 deletions.
14 changes: 6 additions & 8 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ func (e *Engine) Configure(c Config) error {
if c.IncomingPort <= 0 {
return fmt.Errorf("Invalid incoming port (%d)", c.IncomingPort)
}
tc := torrent.ClientConfig{
DataDir: c.DownloadDirectory,
NoUpload: !c.EnableUpload,
Seed: c.EnableSeeding,
ListenHost: func(network string) string { return "0.0.0.0" },
ListenPort: c.IncomingPort,
}

client, err := torrent.NewClient(&tc)
config := torrent.NewDefaultClientConfig()
config.DataDir = c.DownloadDirectory
config.NoUpload = !c.EnableUpload
config.Seed = c.EnableSeeding
config.ListenPort = c.IncomingPort
client, err := torrent.NewClient(config)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion engine/torrent.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type File struct {
//cloud torrent
Started bool
Percent float32
f torrent.File
f *torrent.File
}

func (torrent *Torrent) Update(t *torrent.Torrent) {
Expand Down
11 changes: 4 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ go 1.21

require (
github.com/NYTimes/gziphandler v1.1.1
github.com/anacrolix/dht v1.0.1
github.com/anacrolix/torrent v1.53.2
github.com/elazarl/go-bindata-assetfs v1.0.1
github.com/jpillora/archive v0.0.0-20160301031048-e0b3681851f1
github.com/jpillora/backoff v1.0.0
github.com/jpillora/cookieauth v1.1.1
github.com/jpillora/opts v1.2.3
github.com/jpillora/requestlog v1.0.0
github.com/jpillora/scraper v0.3.0
github.com/jpillora/velox v0.4.1
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/shirou/gopsutil/v3 v3.23.12
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
)

Expand Down Expand Up @@ -63,6 +61,7 @@ require (
github.com/jpillora/ansi v1.0.3 // indirect
github.com/jpillora/eventsource v1.0.0 // indirect
github.com/jpillora/sizestr v1.0.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/pion/datachannel v1.5.2 // indirect
Expand All @@ -85,16 +84,14 @@ require (
github.com/pion/webrtc/v3 v3.1.42 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/posener/complete v1.2.2-0.20190308074557-af07aa5181b3 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 // indirect
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/tklauser/go-sysconf v0.3.13 // indirect
github.com/tklauser/numcpus v0.7.0 // indirect
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce // indirect
github.com/willf/bitset v1.1.10 // indirect
github.com/willf/bloom v2.0.3+incompatible // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opentelemetry.io/otel v1.8.0 // indirect
Expand Down
Loading

0 comments on commit 06f454c

Please sign in to comment.