add bitrate to torr status

This commit is contained in:
YouROK
2023-02-27 23:20:46 +03:00
parent dd9e72ef80
commit f409959b3d
3 changed files with 18 additions and 1 deletions

View File

@@ -42,6 +42,9 @@ type Torrent struct {
PreloadSize int64
PreloadedBytes int64
DurationSeconds float64
BitRate string
expiredTime time.Time
closed <-chan struct{}
@@ -277,6 +280,8 @@ func (t *Torrent) Status() *state.TorrentStatus {
st.Data = t.Data
st.Timestamp = t.Timestamp
st.TorrentSize = t.Size
st.BitRate = t.BitRate
st.DurationSeconds = t.DurationSeconds
if t.TorrentSpec != nil {
st.Hash = t.TorrentSpec.InfoHash.HexString()