diff --git a/main.go b/main.go index 7f5927f..125dfea 100644 --- a/main.go +++ b/main.go @@ -91,29 +91,29 @@ func main() { } sessionStats := []SessionStat{ - {Label: "Active torrent count", Value: fmt.Sprintf("%d", *&stats.ActiveTorrentCount)}, - {Label: "Download speed", Value: fmt.Sprintf("%s/sec", byteCountIEC(*&stats.DownloadSpeed))}, - {Label: "Upload speed", Value: fmt.Sprintf("%s/sec", byteCountIEC(*&stats.UploadSpeed))}, - {Label: "Paused torrent count", Value: fmt.Sprintf("%d", *&stats.PausedTorrentCount)}, - {Label: "Torrent count", Value: fmt.Sprintf("%d", *&stats.TorrentCount)}, + {Label: "Active torrent count", Value: fmt.Sprintf("%d", stats.ActiveTorrentCount)}, + {Label: "Download speed", Value: fmt.Sprintf("%s/sec", byteCountIEC(stats.DownloadSpeed))}, + {Label: "Upload speed", Value: fmt.Sprintf("%s/sec", byteCountIEC(stats.UploadSpeed))}, + {Label: "Paused torrent count", Value: fmt.Sprintf("%d", stats.PausedTorrentCount)}, + {Label: "Torrent count", Value: fmt.Sprintf("%d", stats.TorrentCount)}, } currentStats := []SessionStat{ - {Label: "Uploaded bytes", Value: fmt.Sprintf("%s", byteCountIEC(*&stats.CurrentStats.UploadedBytes))}, - {Label: "Downloaded bytes", Value: fmt.Sprintf("%s", byteCountIEC(*&stats.CurrentStats.DownloadedBytes))}, - {Label: "Uploaded/Downloaded ratio", Value: fmt.Sprintf("%d", *&stats.CurrentStats.UploadedBytes / *&stats.CurrentStats.DownloadedBytes)}, - {Label: "Files added", Value: fmt.Sprintf("%d", *&stats.CurrentStats.FilesAdded)}, - {Label: "Session count", Value: fmt.Sprintf("%d", *&stats.CurrentStats.SessionCount)}, - {Label: "Time active", Value: convertTime(*&stats.CurrentStats.SecondsActive)}, + {Label: "Uploaded bytes", Value: fmt.Sprintf("%s", byteCountIEC(stats.CurrentStats.UploadedBytes))}, + {Label: "Downloaded bytes", Value: fmt.Sprintf("%s", byteCountIEC(stats.CurrentStats.DownloadedBytes))}, + {Label: "Uploaded/Downloaded ratio", Value: fmt.Sprintf("%d", stats.CurrentStats.UploadedBytes/stats.CurrentStats.DownloadedBytes)}, + {Label: "Files added", Value: fmt.Sprintf("%d", stats.CurrentStats.FilesAdded)}, + {Label: "Session count", Value: fmt.Sprintf("%d", stats.CurrentStats.SessionCount)}, + {Label: "Time active", Value: convertTime(stats.CurrentStats.SecondsActive)}, } cumulativeStats := []SessionStat{ - {Label: "Uploaded bytes", Value: fmt.Sprintf("%s", byteCountIEC(*&stats.CumulativeStats.UploadedBytes))}, - {Label: "Downloaded bytes", Value: fmt.Sprintf("%s", byteCountIEC(*&stats.CumulativeStats.DownloadedBytes))}, - {Label: "Uploaded/Downloaded ratio", Value: fmt.Sprintf("%d", *&stats.CumulativeStats.UploadedBytes / *&stats.CumulativeStats.DownloadedBytes)}, - {Label: "Files added", Value: fmt.Sprintf("%d", *&stats.CumulativeStats.FilesAdded)}, - {Label: "Session count", Value: fmt.Sprintf("%d", *&stats.CumulativeStats.SessionCount)}, - {Label: "Time active", Value: convertTime(*&stats.CumulativeStats.SecondsActive)}, + {Label: "Uploaded bytes", Value: fmt.Sprintf("%s", byteCountIEC(stats.CumulativeStats.UploadedBytes))}, + {Label: "Downloaded bytes", Value: fmt.Sprintf("%s", byteCountIEC(stats.CumulativeStats.DownloadedBytes))}, + {Label: "Uploaded/Downloaded ratio", Value: fmt.Sprintf("%d", stats.CumulativeStats.UploadedBytes/stats.CumulativeStats.DownloadedBytes)}, + {Label: "Files added", Value: fmt.Sprintf("%d", stats.CumulativeStats.FilesAdded)}, + {Label: "Session count", Value: fmt.Sprintf("%d", stats.CumulativeStats.SessionCount)}, + {Label: "Time active", Value: convertTime(stats.CumulativeStats.SecondsActive)}, } var torrentInfo = []TorrentInfo{}