mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-22 02:53:09 +01:00
misc fixes
* add null checks before resuming a download * (MissionAdapter.java) reset percent after resuming a download. prevents the "Error" string get stuck, until the download start
This commit is contained in:
parent
df4dd0122f
commit
c4a5e8dc86
@ -407,7 +407,8 @@ public class DownloadMission extends Mission {
|
||||
|
||||
// ensure that the previous state is completely paused.
|
||||
joinForThread(init);
|
||||
for (Thread thread : threads) joinForThread(thread);
|
||||
if (threads != null)
|
||||
for (Thread thread : threads) joinForThread(thread);
|
||||
|
||||
enqueued = false;
|
||||
running = true;
|
||||
@ -420,7 +421,7 @@ public class DownloadMission extends Mission {
|
||||
|
||||
init = null;
|
||||
|
||||
if (threads.length < 1) {
|
||||
if (threads == null || threads.length < 1) {
|
||||
threads = new Thread[currentThreadCount];
|
||||
}
|
||||
|
||||
|
@ -447,6 +447,7 @@ public class MissionAdapter extends Adapter<ViewHolder> {
|
||||
if (mission != null) {
|
||||
switch (id) {
|
||||
case R.id.start:
|
||||
h.status.setText(UNDEFINED_SPEED);
|
||||
h.state = -1;
|
||||
h.size.setText(Utility.formatBytes(mission.getLength()));
|
||||
mDownloadManager.resumeMission(mission);
|
||||
|
Loading…
Reference in New Issue
Block a user