From 4ea4f4c8c80c9c5e59dea0db695eff2ba7bb27cc Mon Sep 17 00:00:00 2001 From: Jeffrey Serio <23226432+hyperreal64@users.noreply.github.com> Date: Wed, 19 Jul 2023 09:59:18 -0500 Subject: [PATCH] Fix torrent-get functions --- go.mod | 6 +++++- go.sum | 4 ++++ html/main.go | 5 ++--- main.go | 7 +++---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index b58a983..7f7bcaa 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,10 @@ go 1.20 require ( github.com/hekmon/cunits/v2 v2.1.0 github.com/hekmon/transmissionrpc v1.1.0 + github.com/olekukonko/tablewriter v0.0.5 ) -require github.com/hashicorp/go-cleanhttp v0.5.1 // indirect +require ( + github.com/hashicorp/go-cleanhttp v0.5.1 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect +) diff --git a/go.sum b/go.sum index d28ce19..9a0c24f 100644 --- a/go.sum +++ b/go.sum @@ -5,3 +5,7 @@ github.com/hekmon/cunits/v2 v2.1.0 h1:k6wIjc4PlacNOHwKEMBgWV2/c8jyD4eRMs5mR1BBhI github.com/hekmon/cunits/v2 v2.1.0/go.mod h1:9r1TycXYXaTmEWlAIfFV8JT+Xo59U96yUJAYHxzii2M= github.com/hekmon/transmissionrpc v1.1.0 h1:58xY27x2JYxaMlIj7ycKnxqgCm3IjvTxfB7cHPLxOfs= github.com/hekmon/transmissionrpc v1.1.0/go.mod h1:qkwhsyD/MQSlWvOE1AC92xajwEveAuGsOvTuOBZEuHc= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= diff --git a/html/main.go b/html/main.go index 893225c..d9d547f 100644 --- a/html/main.go +++ b/html/main.go @@ -1,7 +1,6 @@ package main import ( - "context" "fmt" "html/template" "log" @@ -87,7 +86,7 @@ func main() { log.Fatalln(err) } - stats, err := transmissionbt.SessionStats(context.TODO()) + stats, err := transmissionbt.SessionStats() if err != nil { log.Fatalln(err) } @@ -122,7 +121,7 @@ func main() { seederCount int64 ) - torrents, err := transmissionbt.TorrentGet(context.TODO(), []string{"name", "activityDate", "totalSize", "trackerStats"}, nil) + torrents, err := transmissionbt.TorrentGet([]string{"name", "activityDate", "totalSize", "trackerStats"}, nil) if err != nil { fmt.Fprintln(os.Stderr, err) } else { diff --git a/main.go b/main.go index d8c7604..86fb9d7 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,6 @@ -qpackage main +package main import ( - "context" "fmt" "log" "os" @@ -89,7 +88,7 @@ func main() { log.Fatalln(err) } - stats, err := transmissionbt.SessionStats(context.TODO()) + stats, err := transmissionbt.SessionStats() if err != nil { log.Fatalln(err) } @@ -137,7 +136,7 @@ func main() { ) fmt.Println("TORRENT STATS") - torrents, err := transmissionbt.TorrentGet(context.TODO(), []string{ + torrents, err := transmissionbt.TorrentGet([]string{ "activityDate", "name", "totalSize",