mirror of
https://codeberg.org/hyperreal/go-transmission-stats
synced 2024-11-25 12:13:42 +01:00
Fix torrent-get functions
This commit is contained in:
parent
99b524a870
commit
4ea4f4c8c8
6
go.mod
6
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
|
||||
)
|
||||
|
4
go.sum
4
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=
|
||||
|
@ -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 {
|
||||
|
7
main.go
7
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",
|
||||
|
Loading…
Reference in New Issue
Block a user