Add context.TODO() to torrent-get functions

This commit is contained in:
Jeffrey Serio 2023-07-19 17:01:54 -05:00
parent 7ef4dde3b1
commit 50115dc2de
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"context"
"fmt" "fmt"
"html/template" "html/template"
"log" "log"
@ -90,7 +91,7 @@ func main() {
log.Fatalln(err) log.Fatalln(err)
} }
stats, err := transmissionbt.SessionStats() stats, err := transmissionbt.SessionStats(context.TODO())
if err != nil { if err != nil {
log.Fatalln(err) log.Fatalln(err)
} }
@ -125,7 +126,7 @@ func main() {
seederCount int64 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 { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
} else { } else {

View File

@ -1,6 +1,7 @@
package main package main
import ( import (
"context"
"fmt" "fmt"
"log" "log"
"os" "os"
@ -92,7 +93,7 @@ func main() {
log.Fatalln(err) log.Fatalln(err)
} }
stats, err := transmissionbt.SessionStats() stats, err := transmissionbt.SessionStats(context.TODO())
if err != nil { if err != nil {
log.Fatalln(err) log.Fatalln(err)
} }
@ -140,7 +141,7 @@ func main() {
) )
fmt.Println("TORRENT STATS") fmt.Println("TORRENT STATS")
torrents, err := transmissionbt.TorrentGet([]string{ torrents, err := transmissionbt.TorrentGet(context.TODO(), []string{
"activityDate", "activityDate",
"name", "name",
"totalSize", "totalSize",