Skip to content

Commit

Permalink
show upload rate when seeding
Browse files Browse the repository at this point in the history
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
  • Loading branch information
scakemyer committed Jan 19, 2016
1 parent 7e451e4 commit 8225ffd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.0
0.6.3
12 changes: 9 additions & 3 deletions bittorrent/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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(),
Expand Down

1 comment on commit 8225ffd

@i96751414
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree and I don't agree with this. Upload rate is an important information but we shouldn't get rid of Download rate. Could you please change the string to D:%.0fkb/s U:%.0fkb/s ?

Finally, I'm not understanding why you think it's better to remove size checking... Could you explain?

Please sign in to comment.