se-bastiaan / TorrentStream-Android

A torrent streamer library for Android based on libtorrent4j
Other
343 stars 108 forks source link

Download speed should be int #58

Closed getsnoopy closed 4 years ago

getsnoopy commented 4 years ago

Why is the download speed stored as a float, especially when the upstream library returns it as an int? The value is in bytes per second, and it can never be a decimal.

https://github.com/TorrentStream/TorrentStream-Android/blob/180c1a1ab875fddfa20b98f8b799030510be59ee/library/src/main/java/com/github/se_bastiaan/torrentstream/StreamStatus.java#L23

Even the constructor accepts it as an int: https://github.com/TorrentStream/TorrentStream-Android/blob/180c1a1ab875fddfa20b98f8b799030510be59ee/library/src/main/java/com/github/se_bastiaan/torrentstream/StreamStatus.java#L25

se-bastiaan commented 4 years ago

I must say that I'm guessing. I think past me from 5 years ago probably just made some design choice, then moved to integers and forgot to change this to an int.

You're welcome to open a pull request.