misc improvements

* don't show notifications while download activity
* proper icon in failed download notifications
* re-write list auto-refresh (MissionAdapter.java)
* improve I/O performance (CircularFile.java)
* fix implementation of "save thread position" on multi-thread downloads
This commit is contained in:
kapodamy 2018-11-26 00:20:25 -03:00
parent f3d4d4747a
commit eba3b32708
11 changed files with 270 additions and 184 deletions

View file

@ -221,12 +221,12 @@ public class DownloadMission extends Mission {
}
/**
* Get position inside of the block, where thread will be resumed
* Get position inside of the thread, where thread will be resumed
*
* @param threadId the identifier of the thread
* @return the relative position in bytes or zero
*/
long getBlockBytePosition(int threadId) {
long getThreadBytePosition(int threadId) {
return threadBytePositions.get(threadId);
}
@ -256,6 +256,8 @@ public class DownloadMission extends Mission {
}
}
conn.connect();
int statusCode = conn.getResponseCode();
switch (statusCode) {
case 204:
@ -446,6 +448,8 @@ public class DownloadMission extends Mission {
return;
}
if (postprocessingRunning) return;
// wait for all threads are suspended before save the state
runAsync(-1, () -> {
try {
@ -590,7 +594,7 @@ public class DownloadMission extends Mission {
@Override
public String getMessage() {
return "Http status code" + String.valueOf(statusCode);
return "Http status code: " + String.valueOf(statusCode);
}
}
}