From ad58dce3953b79e7d5a4c5b96a00ea86c2bd8af3 Mon Sep 17 00:00:00 2001 From: laoyuyu <511455842@qq.com> Date: Thu, 20 Feb 2020 19:58:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=84=E5=90=88=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8D=95=E4=B8=AA=E5=AD=90=E4=BB=BB=E5=8A=A1=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=90=8E=EF=BC=8C=E9=87=8D=E6=96=B0=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E7=BB=84=E5=90=88=E4=BB=BB=E5=8A=A1=EF=BC=8C=E7=BB=84=E5=90=88?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=8A=B6=E6=80=81=E5=8F=98=E4=B8=BA=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEV_LOG.md | 3 +++ .../aria/core/common/RecordHandler.java | 6 ++++++ .../aria/core/common/RecordHelper.java | 2 +- app/src/main/assets/aria_config.xml | 2 +- .../download/group/DownloadGroupActivity.java | 7 +++++-- .../core/download/group/GroupModule.java | 19 +++++++++++++++---- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/DEV_LOG.md b/DEV_LOG.md index f7a2cc03..44712ecc 100644 --- a/DEV_LOG.md +++ b/DEV_LOG.md @@ -1,4 +1,7 @@ ## 开发日志 + + v_3.8.7 + - 修复组合任务单个子任务失败后,重新恢复组合任务,组合任务状态变为完成的问题 + + v_3.8.6 (2020/2/17) - fix bug https://github.com/AriaLyy/Aria/issues/608 - fix bug https://github.com/AriaLyy/Aria/issues/579#issuecomment-586665035 diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/common/RecordHandler.java b/PublicComponent/src/main/java/com/arialyy/aria/core/common/RecordHandler.java index cf8bdbd5..8e5f0c1e 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/core/common/RecordHandler.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/common/RecordHandler.java @@ -30,6 +30,7 @@ import com.arialyy.aria.util.CommonUtil; import com.arialyy.aria.util.DbDataHelper; import com.arialyy.aria.util.FileUtil; import java.io.File; +import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Properties; @@ -84,6 +85,11 @@ public abstract class RecordHandler implements IRecordHandler { mTaskRecord = DbDataHelper.getTaskRecord(getFilePath(), mEntity.getTaskType()); if (mTaskRecord == null) { initRecord(true); + }else if (mTaskRecord.threadRecords == null || mTaskRecord.threadRecords.size() == 0){ + if (mTaskRecord.threadRecords == null){ + mTaskRecord.threadRecords = new ArrayList<>(); + } + initRecord(false); } handlerTaskRecord(mTaskRecord); } diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/common/RecordHelper.java b/PublicComponent/src/main/java/com/arialyy/aria/core/common/RecordHelper.java index 9942ff89..63b4200b 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/core/common/RecordHelper.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/common/RecordHelper.java @@ -174,7 +174,7 @@ public class RecordHelper { tr.startLocation = 0; tr.isComplete = false; tr.endLocation = mWrapper.getEntity().getFileSize(); - } else if (file.length() == mWrapper.getEntity().getFileSize()) { + } else if (file.length() != 0 && file.length() == mWrapper.getEntity().getFileSize()) { ALog.d(TAG, "文件长度一致,线程完成"); tr.isComplete = true; } else { diff --git a/app/src/main/assets/aria_config.xml b/app/src/main/assets/aria_config.xml index 56a3067d..26626b21 100644 --- a/app/src/main/assets/aria_config.xml +++ b/app/src/main/assets/aria_config.xml @@ -131,7 +131,7 @@ - + diff --git a/app/src/main/java/com/arialyy/simple/core/download/group/DownloadGroupActivity.java b/app/src/main/java/com/arialyy/simple/core/download/group/DownloadGroupActivity.java index 193080d2..b27f5231 100644 --- a/app/src/main/java/com/arialyy/simple/core/download/group/DownloadGroupActivity.java +++ b/app/src/main/java/com/arialyy/simple/core/download/group/DownloadGroupActivity.java @@ -163,8 +163,11 @@ public class DownloadGroupActivity extends BaseActivity urls = new ArrayList<>(); //urls.add("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1574141924275&di=a7ea1497a4a2528a45ce7103bf61adf4&imgtype=0&src=http%3A%2F%2Fg.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2Fc2cec3fdfc03924590b2a9b58d94a4c27d1e2500.jpg"); //urls.add("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1574141924272&di=7861479e7cb3cea98d585eaf108f056f&imgtype=0&src=http%3A%2F%2Fd.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2F562c11dfa9ec8a13c0741f5afd03918fa0ecc01a.jpg"); - String[] str = getContext().getResources().getStringArray(R.array.group_urls_1); - Collections.addAll(urls, str); + //String[] str = getContext().getResources().getStringArray(R.array.group_urls_1); + //Collections.addAll(urls, str); + urls.add("http://img2.imgtn.bdimg.com/it/u=3105600238,693167464&fm=26&gp=0.jpg"); + urls.add("http://a4.att.hudong.com/22/59/19300001325156131228593878903.jpg"); + urls.add("http://pic1.win4000.com/mobile/2019-12-16/5df71dc866a0c.jpg"); + urls.add("http://pics4.baidu.com/feed/e824b899a9014c08545e5585620d360e7bf4f421.jpeg"); + urls.add("http://img.blog.163.com/photo/iFUKcs6shB4PNlfxwH-yTw==/2542563464627686395.jpg"); + return urls; } @@ -49,8 +55,13 @@ public class GroupModule extends BaseModule { List getSubName() { List names = new ArrayList<>(); - String[] str = getContext().getResources().getStringArray(R.array.group_names); - Collections.addAll(names, str); + //String[] str = getContext().getResources().getStringArray(R.array.group_names); + //Collections.addAll(names, str); + names.add("1.png"); + names.add("2.png"); + names.add("3.png"); + names.add("4.png"); + names.add("5.png"); return names; }