Merge pull request #2848 from egsavage/feature/2829-map-queues-time-left-to-current-playback-speed

Resolves #2829 - Make queue remaining time sensitive to playback speed
This commit is contained in:
Martin Fietz 2018-10-11 19:09:24 +02:00 committed by GitHub
commit 32b83a1760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -21,7 +21,6 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration; import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration;
@ -46,7 +45,6 @@ import de.danoeh.antennapod.core.service.download.Downloader;
import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.storage.DownloadRequestException;
import de.danoeh.antennapod.core.storage.DownloadRequester; import de.danoeh.antennapod.core.storage.DownloadRequester;
import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.Converter;
import de.danoeh.antennapod.core.util.FeedItemUtil; import de.danoeh.antennapod.core.util.FeedItemUtil;
@ -535,9 +533,12 @@ public class QueueFragment extends Fragment {
String info = queue.size() + getString(R.string.episodes_suffix); String info = queue.size() + getString(R.string.episodes_suffix);
if(queue.size() > 0) { if(queue.size() > 0) {
long timeLeft = 0; long timeLeft = 0;
float playbackSpeed = Float.valueOf(UserPreferences.getPlaybackSpeed());
for(FeedItem item : queue) { for(FeedItem item : queue) {
if(item.getMedia() != null) { if(item.getMedia() != null) {
timeLeft += item.getMedia().getDuration() - item.getMedia().getPosition(); timeLeft +=
(item.getMedia().getDuration() - item.getMedia().getPosition())
/ playbackSpeed;
} }
} }
info += " \u2022 "; info += " \u2022 ";