Fixed info bar ignoring 'time respects playback speed' setting

This commit is contained in:
ByteHamster 2019-11-12 22:42:56 +01:00
parent 19a6f613e9
commit 6c7d5e167b

View File

@ -653,14 +653,16 @@ public class QueueFragment extends Fragment {
private void refreshInfoBar() {
String info = queue.size() + getString(R.string.episodes_suffix);
if(queue.size() > 0) {
if (queue.size() > 0) {
long timeLeft = 0;
for(FeedItem item : queue) {
float playbackSpeed = PlaybackSpeedUtils.getCurrentPlaybackSpeed(item.getMedia());
if(item.getMedia() != null) {
timeLeft +=
(long) ((item.getMedia().getDuration() - item.getMedia().getPosition())
/ playbackSpeed);
for (FeedItem item : queue) {
float playbackSpeed = 1;
if (UserPreferences.timeRespectsSpeed()) {
playbackSpeed = PlaybackSpeedUtils.getCurrentPlaybackSpeed(item.getMedia());
}
if (item.getMedia() != null) {
long itemTimeLeft = item.getMedia().getDuration() - item.getMedia().getPosition();
timeLeft += itemTimeLeft / playbackSpeed;
}
}
info += "";