// RemoteStats produces stats for this file
RemoteStats produces stats for this file
// RemoteStats produces stats for this file
func (acc *Account) RemoteStats() (out map[string]interface{}) {
	out = make(map[string]interface{})
	a, b := acc.progress()
	out["bytes"] = a
	out["size"] = b
	spd, cur := acc.speed()
	out["speed"] = spd
	out["speedAvg"] = cur
	eta, etaok := acc.eta()
	out["eta"] = nil
	if etaok {
		if eta > 0 {
			out["eta"] = eta.Seconds()
		} else {
			out["eta"] = 0
		}
	}
	out["name"] = acc.name
	percentageDone := 0
	if b > 0 {
		percentageDone = int(100 * float64(a) / float64(b))
	}
	out["percentage"] = percentageDone
	return out
}
func ( acc * Account ) RemoteStats ( ) ( out map [ string ] interface { } ) { out = make ( map [ string ] interface { } ) a , b := acc . progress ( ) out [ " " ] = a out [ " " ] = b spd , cur := acc . speed ( ) out [ " " ] = spd out [ " " ] = cur eta , etaok := acc . eta ( ) out [ " " ] = nil if etaok { if eta > 0 { out [ " " ] = eta . Seconds ( ) } else { out [ " " ] = 0 } } out [ " " ] = acc . name percentageDone := 0 if b > 0 { percentageDone = int ( 100 * float64 ( a ) / float64 ( b ) ) } out [ " " ] = percentageDone return out }
RemoteStats produces stats for this file
RemoteStats produces stats for this file