AriaLyy 7 years ago
parent a310df2281
commit 887026bb04
  1. 4
      Aria/src/main/java/com/arialyy/aria/core/download/BaseDListener.java
  2. 3
      Aria/src/main/java/com/arialyy/aria/core/download/downloader/AbsGroupUtil.java
  3. 3
      Aria/src/main/java/com/arialyy/aria/core/upload/BaseUListener.java
  4. 3
      DEV_LOG.md
  5. 3
      aria/src/main/java/com/arialyy/aria/core/Configuration.java

@ -128,7 +128,9 @@ class BaseDListener<ENTITY extends AbsEntity, TASK_ENTITY extends AbsTaskEntity<
} else { } else {
mEntity.setSpeed(speed < 0 ? 0 : speed); mEntity.setSpeed(speed < 0 ? 0 : speed);
} }
mEntity.setPercent((int) (mEntity.getCurrentProgress() * 100 / mEntity.getFileSize()));
mEntity.setPercent((int) (mEntity.getFileSize() <= 0 ? 0
: mEntity.getCurrentProgress() * 100 / mEntity.getFileSize()));
} }
/** /**

@ -566,7 +566,8 @@ public abstract class AbsGroupUtil implements IUtil {
private void handleSpeed(long speed) { private void handleSpeed(long speed) {
subEntity.setSpeed(speed); subEntity.setSpeed(speed);
subEntity.setConvertSpeed(speed <= 0 ? "" : CommonUtil.formatFileSize(speed) + "/s"); subEntity.setConvertSpeed(speed <= 0 ? "" : CommonUtil.formatFileSize(speed) + "/s");
subEntity.setPercent((int) (subEntity.getCurrentProgress() * 100 / subEntity.getFileSize())); subEntity.setPercent((int) (subEntity.getFileSize() <= 0 ? 0
: subEntity.getCurrentProgress() * 100 / subEntity.getFileSize()));
} }
private void saveData(int state, long location) { private void saveData(int state, long location) {

@ -116,7 +116,8 @@ class BaseUListener<ENTITY extends AbsEntity, TASK_ENTITY extends AbsTaskEntity<
} else { } else {
mEntity.setSpeed(speed < 0 ? 0 : speed); mEntity.setSpeed(speed < 0 ? 0 : speed);
} }
mEntity.setPercent((int) (mEntity.getCurrentProgress() * 100 / mEntity.getFileSize())); mEntity.setPercent((int) (mEntity.getFileSize() <= 0 ? 0
: mEntity.getCurrentProgress() * 100 / mEntity.getFileSize()));
} }
/** /**

@ -1,4 +1,7 @@
## 开发日志 ## 开发日志
+ v_3.3.7
- 修复一个线程重启的问题 https://github.com/AriaLyy/Aria/issues/160
- 修复配置文件异常问题、格式化速度为0问题 https://github.com/AriaLyy/Aria/issues/161
+ v_3.3.6 + v_3.3.6
- 增加日志输出级别控制 - 增加日志输出级别控制
- 修复公网FTP地址不能下载的问题 https://github.com/AriaLyy/Aria/issues/146 - 修复公网FTP地址不能下载的问题 https://github.com/AriaLyy/Aria/issues/146

@ -152,7 +152,8 @@ class Configuration {
: UPLOAD_CONFIG_FILE)); : UPLOAD_CONFIG_FILE));
if (file.exists()) { if (file.exists()) {
Properties properties = CommonUtil.loadConfig(file); Properties properties = CommonUtil.loadConfig(file);
List<Field> fields = CommonUtil.getAllFields(getClass()); List<Field> fields =
CommonUtil.getAllFields(isDownload ? DownloadConfig.class : UploadConfig.class);
try { try {
for (Field field : fields) { for (Field field : fields) {
int m = field.getModifiers(); int m = field.getModifiers();

Loading…
Cancel
Save