mirror of
https://codeberg.org/hyperreal/go-transmission-stats
synced 2024-11-25 12:13:42 +01:00
Add context.TODO() to torrent-get functions
This commit is contained in:
parent
7ef4dde3b1
commit
50115dc2de
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"log"
|
||||
@ -90,7 +91,7 @@ func main() {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
stats, err := transmissionbt.SessionStats()
|
||||
stats, err := transmissionbt.SessionStats(context.TODO())
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
@ -125,7 +126,7 @@ func main() {
|
||||
seederCount int64
|
||||
)
|
||||
|
||||
torrents, err := transmissionbt.TorrentGet([]string{"name", "activityDate", "totalSize", "trackerStats"}, nil)
|
||||
torrents, err := transmissionbt.TorrentGet(context.TODO(), []string{"name", "activityDate", "totalSize", "trackerStats"}, nil)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
} else {
|
||||
|
5
main.go
5
main.go
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
@ -92,7 +93,7 @@ func main() {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
stats, err := transmissionbt.SessionStats()
|
||||
stats, err := transmissionbt.SessionStats(context.TODO())
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
@ -140,7 +141,7 @@ func main() {
|
||||
)
|
||||
|
||||
fmt.Println("TORRENT STATS")
|
||||
torrents, err := transmissionbt.TorrentGet([]string{
|
||||
torrents, err := transmissionbt.TorrentGet(context.TODO(), []string{
|
||||
"activityDate",
|
||||
"name",
|
||||
"totalSize",
|
||||
|
Loading…
Reference in New Issue
Block a user