From 0765ab67f7d5f89fba51b9326b2fa59b5a48deb2 Mon Sep 17 00:00:00 2001 From: laoyuyu <511455842@qq.com> Date: Wed, 20 Nov 2019 10:17:08 +0800 Subject: [PATCH] 3.7.7 --- DEV_LOG.md | 3 +++ .../aria/core/task/AbsThreadTaskAdapter.java | 7 +---- .../aria/core/task/IThreadTaskObserver.java | 5 ++++ .../arialyy/aria/core/task/ThreadTask.java | 5 ++++ .../com/arialyy/aria/util/ComponentUtil.java | 3 --- README.md | 27 ++++++++----------- build.gradle | 4 +-- 7 files changed, 27 insertions(+), 27 deletions(-) diff --git a/DEV_LOG.md b/DEV_LOG.md index fa4f7b3d..cc6b7ec2 100644 --- a/DEV_LOG.md +++ b/DEV_LOG.md @@ -1,4 +1,7 @@ ## 开发日志 + + v_3.7.7 (2019/11/20) + - 修复ftp无法完成下载的问题 + - 修复一个http下载崩溃的问题 + v_3.7.6 (2019/11/19) - fix bug https://github.com/AriaLyy/Aria/issues/505 - fix bug https://github.com/AriaLyy/Aria/issues/516 diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/task/AbsThreadTaskAdapter.java b/PublicComponent/src/main/java/com/arialyy/aria/core/task/AbsThreadTaskAdapter.java index 4869426c..32593444 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/core/task/AbsThreadTaskAdapter.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/task/AbsThreadTaskAdapter.java @@ -34,10 +34,6 @@ public abstract class AbsThreadTaskAdapter implements IThreadTaskAdapter { * 速度限制工具 */ protected BandwidthLimiter mSpeedBandUtil; - /** - * 当前线程的下去区间的进度 - */ - private long mRangeProgress; private ThreadRecord mThreadRecord; private IThreadTaskObserver mObserver; private AbsTaskWrapper mWrapper; @@ -48,7 +44,6 @@ public abstract class AbsThreadTaskAdapter implements IThreadTaskAdapter { mThreadRecord = config.record; mWrapper = config.taskWrapper; mThreadConfig = config; - mRangeProgress = mThreadRecord.startLocation; if (getTaskConfig().getMaxSpeed() > 0) { mSpeedBandUtil = new BandwidthLimiter(getTaskConfig().getMaxSpeed(), config.startThreadNum); } @@ -68,7 +63,7 @@ public abstract class AbsThreadTaskAdapter implements IThreadTaskAdapter { * 当前线程的下去区间的进度 */ protected long getRangeProgress() { - return mRangeProgress; + return mObserver.getThreadProgress(); } protected ThreadRecord getThreadRecord() { diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/task/IThreadTaskObserver.java b/PublicComponent/src/main/java/com/arialyy/aria/core/task/IThreadTaskObserver.java index 8a92bcf3..1b9b6016 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/core/task/IThreadTaskObserver.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/task/IThreadTaskObserver.java @@ -53,4 +53,9 @@ public interface IThreadTaskObserver { * @param len 新增的长度 */ void updateProgress(long len); + + /** + * 获取线程当前进度 + */ + long getThreadProgress(); } diff --git a/PublicComponent/src/main/java/com/arialyy/aria/core/task/ThreadTask.java b/PublicComponent/src/main/java/com/arialyy/aria/core/task/ThreadTask.java index 7dd1c54d..9a62b7f6 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/core/task/ThreadTask.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/core/task/ThreadTask.java @@ -318,6 +318,11 @@ public class ThreadTask implements IThreadTask, IThreadTaskObserver { } } + @Override + public long getThreadProgress() { + return mRangeProgress; + } + /** * 取消任务 */ diff --git a/PublicComponent/src/main/java/com/arialyy/aria/util/ComponentUtil.java b/PublicComponent/src/main/java/com/arialyy/aria/util/ComponentUtil.java index 080e92f4..5ea85006 100644 --- a/PublicComponent/src/main/java/com/arialyy/aria/util/ComponentUtil.java +++ b/PublicComponent/src/main/java/com/arialyy/aria/util/ComponentUtil.java @@ -101,9 +101,6 @@ public class ComponentUtil { public T buildUtil(AbsTaskWrapper wrapper, IEventListener listener) { int requestType = wrapper.getRequestType(); String className = null; - if (requestType == 1){ - throw new IllegalArgumentException("xxxx"); - } switch (requestType) { case ITaskWrapper.M3U8_LIVE: className = "com.arialyy.aria.m3u8.live.M3U8LiveUtil"; diff --git a/README.md b/README.md index 8b31e914..ee2e70ce 100644 --- a/README.md +++ b/README.md @@ -44,16 +44,16 @@ Aria有以下特点: ## 引入库 [![license](http://img.shields.io/badge/license-Apache2.0-brightgreen.svg?style=flat)](https://github.com/AriaLyy/Aria/blob/master/LICENSE) -[![Core](https://img.shields.io/badge/Core-3.7.6-blue)](https://github.com/AriaLyy/Aria) -[![Compiler](https://img.shields.io/badge/Compiler-3.7.6-blue)](https://github.com/AriaLyy/Aria) -[![FtpComponent](https://img.shields.io/badge/FtpComponent-3.7.6-orange)](https://github.com/AriaLyy/Aria) -[![M3U8Component](https://img.shields.io/badge/M3U8Component-3.7.6-orange)](https://github.com/AriaLyy/Aria) +[![Core](https://img.shields.io/badge/Core-3.7.7-blue)](https://github.com/AriaLyy/Aria) +[![Compiler](https://img.shields.io/badge/Compiler-3.7.7-blue)](https://github.com/AriaLyy/Aria) +[![FtpComponent](https://img.shields.io/badge/FtpComponent-3.7.7-orange)](https://github.com/AriaLyy/Aria) +[![M3U8Component](https://img.shields.io/badge/M3U8Component-3.7.7-orange)](https://github.com/AriaLyy/Aria) ```java -implementation 'com.arialyy.aria:core:3.7.6' -annotationProcessor 'com.arialyy.aria:compiler:3.7.6' -implementation 'com.arialyy.aria:ftpComponent:3.7.6' # 如果需要使用ftp,请增加该组件 -implementation 'com.arialyy.aria:m3u8Component:3.7.6' # 如果需要使用m3u8下载功能,请增加该组件 +implementation 'com.arialyy.aria:core:3.7.7' +annotationProcessor 'com.arialyy.aria:compiler:3.7.7' +implementation 'com.arialyy.aria:ftpComponent:3.7.7' # 如果需要使用ftp,请增加该组件 +implementation 'com.arialyy.aria:m3u8Component:3.7.7' # 如果需要使用m3u8下载功能,请增加该组件 ``` 如果出现android support依赖错误,请将 `compile 'com.arialyy.aria:core:'`替换为 ``` @@ -137,14 +137,9 @@ protected void onCreate(Bundle savedInstanceState) { ### 版本日志 - + v_3.7.6 (2019/11/19) - - fix bug https://github.com/AriaLyy/Aria/issues/505 - - fix bug https://github.com/AriaLyy/Aria/issues/516 - - fix bug https://github.com/AriaLyy/Aria/issues/515 - - 增加强制上传的api`forceUpload()` - - 修复for循环上传文件出现的问题 - - 移除创建任务的500ms间隔限制 - - 修复多线程读写时可能出现的`database is locked`的问题 + + v_3.7.7 (2019/11/20) + - 修复ftp无法完成下载的问题 + - 修复一个http下载崩溃的问题 [更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md) diff --git a/build.gradle b/build.gradle index 5d899125..59427992 100644 --- a/build.gradle +++ b/build.gradle @@ -44,8 +44,8 @@ task clean(type: Delete) { } ext { - versionCode = 376 - versionName = '3.7.6' + versionCode = 377 + versionName = '3.7.7' userOrg = 'arialyy' groupId = 'com.arialyy.aria' publishVersion = versionName