From 8225ffde9675730b3caed0ad31bd568afc7657ad Mon Sep 17 00:00:00 2001 From: scakemyer Date: Tue, 19 Jan 2016 10:22:05 -0500 Subject: [PATCH] show upload rate when seeding only warn of unsufficient free space as resumed downloads expect the total size wrongly (will need to use status.GetTotal_done() elsewhere for an accurate check) bump version to match plugin --- VERSION | 2 +- bittorrent/player.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index a918a2aa..844f6a91 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0 +0.6.3 diff --git a/bittorrent/player.go b/bittorrent/player.go index cc22657c..193e4436 100644 --- a/bittorrent/player.go +++ b/bittorrent/player.go @@ -149,8 +149,8 @@ func (btp *BTPlayer) onMetadataReceived() { if btp.diskStatus.Free < torrentSize { btp.log.Info("Unsufficient free space on %s. Has %d, needs %d.", btp.bts.config.DownloadPath, btp.diskStatus.Free, torrentSize) xbmc.Notify("Pulsar", "LOCALIZE[30207]", config.AddonIcon()) - btp.bufferEvents.Broadcast(errors.New("Not enough space on download destination.")) - return + // btp.bufferEvents.Broadcast(errors.New("Not enough space on download destination.")) + // return } } @@ -209,8 +209,14 @@ func (btp *BTPlayer) statusStrings(progress float64, status libtorrent.Torrent_s if btp.torrentInfo != nil && btp.torrentInfo.Swigcptr() != 0 { line1 += " - " + humanize.Bytes(uint64(btp.torrentInfo.Total_size())) } + rate := float64(0) + if status.GetState() == 5 { + rate = float64(status.GetUpload_rate())/1024 + } else { + rate = float64(status.GetDownload_rate())/1024 + } line2 := fmt.Sprintf("%.0fkb/s S:%d/%d P:%d/%d", - float64(status.GetDownload_rate())/1024, + rate, status.GetNum_seeds(), status.GetNum_complete(), status.GetNum_peers(),