Merge pull request #3607 from ByteHamster/fix-3602

Fixed info bar ignoring 'time respects playback speed' setting
This commit is contained in:
H. Lehmann 2019-11-13 00:42:41 +01:00 committed by GitHub
commit 8dff37e94e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 7 deletions

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 += "";