Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29f9bdcdbd |
@@ -1,4 +1,7 @@
|
|||||||
## 开发日志
|
## 开发日志
|
||||||
|
+ v_3.8.8 (2020/6/7)
|
||||||
|
- 修复设置了cancel(false),文件还是被删除的问题 https://github.com/AriaLyy/Aria/issues/686
|
||||||
|
- 修复错误url的下载任务,无法删除的问题 https://github.com/AriaLyy/Aria/issues/684
|
||||||
+ v_3.8.7 (2020/5/25)
|
+ v_3.8.7 (2020/5/25)
|
||||||
- 修复组合任务单个子任务失败后,重新恢复组合任务,组合任务状态变为完成的问题
|
- 修复组合任务单个子任务失败后,重新恢复组合任务,组合任务状态变为完成的问题
|
||||||
- 修复40x错误,会继续重试并且无法重试成功的问题 https://github.com/AriaLyy/Aria/issues/619
|
- 修复40x错误,会继续重试并且无法重试成功的问题 https://github.com/AriaLyy/Aria/issues/619
|
||||||
|
|||||||
@@ -32,14 +32,14 @@ public class DeleteDRecord implements IDeleteRecord {
|
|||||||
private String TAG = CommonUtil.getClassName(this);
|
private String TAG = CommonUtil.getClassName(this);
|
||||||
private static volatile DeleteDRecord INSTANCE = null;
|
private static volatile DeleteDRecord INSTANCE = null;
|
||||||
|
|
||||||
private DeleteDRecord(){
|
private DeleteDRecord() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DeleteDRecord getInstance() {
|
public static DeleteDRecord getInstance() {
|
||||||
if (INSTANCE == null){
|
if (INSTANCE == null) {
|
||||||
synchronized (DeleteDRecord.class){
|
synchronized (DeleteDRecord.class) {
|
||||||
if (INSTANCE == null){
|
if (INSTANCE == null) {
|
||||||
INSTANCE = new DeleteDRecord();
|
INSTANCE = new DeleteDRecord();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,8 @@ public class DeleteDRecord implements IDeleteRecord {
|
|||||||
File targetFile = new File(filePath);
|
File targetFile = new File(filePath);
|
||||||
|
|
||||||
// 兼容以前版本
|
// 兼容以前版本
|
||||||
if (entity.getTaskType() == ITaskWrapper.M3U8_VOD || entity.getTaskType() == ITaskWrapper.M3U8_LIVE){
|
if (entity.getTaskType() == ITaskWrapper.M3U8_VOD
|
||||||
|
|| entity.getTaskType() == ITaskWrapper.M3U8_LIVE) {
|
||||||
DeleteM3u8Record.getInstance().deleteRecord(entity, needRemoveFile, needRemoveEntity);
|
DeleteM3u8Record.getInstance().deleteRecord(entity, needRemoveFile, needRemoveEntity);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -92,13 +93,18 @@ public class DeleteDRecord implements IDeleteRecord {
|
|||||||
TaskRecord record = DbDataHelper.getTaskRecord(entity.getFilePath(), entity.getTaskType());
|
TaskRecord record = DbDataHelper.getTaskRecord(entity.getFilePath(), entity.getTaskType());
|
||||||
if (record == null) {
|
if (record == null) {
|
||||||
ALog.e(TAG, "删除下载记录失败,记录为空,filePath:" + entity.getFilePath());
|
ALog.e(TAG, "删除下载记录失败,记录为空,filePath:" + entity.getFilePath());
|
||||||
|
FileUtil.deleteFile(targetFile);
|
||||||
|
DbEntity.deleteData(DownloadEntity.class, "downloadPath=?", filePath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除下载的线程记录和任务记录
|
||||||
DbEntity.deleteData(ThreadRecord.class, "taskKey=? AND threadType=?", filePath,
|
DbEntity.deleteData(ThreadRecord.class, "taskKey=? AND threadType=?", filePath,
|
||||||
String.valueOf(entity.getTaskType()));
|
String.valueOf(entity.getTaskType()));
|
||||||
|
DbEntity.deleteData(TaskRecord.class, "filePath=? AND taskType=?", filePath,
|
||||||
|
String.valueOf(entity.getTaskType()));
|
||||||
|
|
||||||
if (needRemoveEntity || !entity.isComplete()) {
|
if (needRemoveFile || !entity.isComplete()) {
|
||||||
FileUtil.deleteFile(targetFile);
|
FileUtil.deleteFile(targetFile);
|
||||||
if (record.isBlock) {
|
if (record.isBlock) {
|
||||||
removeBlockFile(record);
|
removeBlockFile(record);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package com.arialyy.aria.util;
|
|||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import com.arialyy.aria.core.TaskRecord;
|
import com.arialyy.aria.core.TaskRecord;
|
||||||
|
import com.arialyy.aria.core.ThreadRecord;
|
||||||
import com.arialyy.aria.core.common.AbsEntity;
|
import com.arialyy.aria.core.common.AbsEntity;
|
||||||
import com.arialyy.aria.core.download.DownloadEntity;
|
import com.arialyy.aria.core.download.DownloadEntity;
|
||||||
import com.arialyy.aria.core.download.M3U8Entity;
|
import com.arialyy.aria.core.download.M3U8Entity;
|
||||||
@@ -82,6 +83,11 @@ public class DeleteM3u8Record implements IDeleteRecord {
|
|||||||
}
|
}
|
||||||
final String filePath = entity.getFilePath();
|
final String filePath = entity.getFilePath();
|
||||||
|
|
||||||
|
// 删除下载的线程记录和任务记录
|
||||||
|
DbEntity.deleteData(ThreadRecord.class, "taskKey=? AND threadType=?", filePath,
|
||||||
|
String.valueOf(entity.getTaskType()));
|
||||||
|
DbEntity.deleteData(TaskRecord.class, "filePath=? AND taskType=?", filePath,
|
||||||
|
String.valueOf(entity.getTaskType()));
|
||||||
DbEntity.deleteData(M3U8Entity.class, "filePath=?", filePath);
|
DbEntity.deleteData(M3U8Entity.class, "filePath=?", filePath);
|
||||||
|
|
||||||
if (needRemoveFile || !entity.isComplete()) {
|
if (needRemoveFile || !entity.isComplete()) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ package com.arialyy.aria.util;
|
|||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import com.arialyy.aria.core.TaskRecord;
|
import com.arialyy.aria.core.TaskRecord;
|
||||||
|
import com.arialyy.aria.core.ThreadRecord;
|
||||||
import com.arialyy.aria.core.common.AbsEntity;
|
import com.arialyy.aria.core.common.AbsEntity;
|
||||||
import com.arialyy.aria.core.upload.UploadEntity;
|
import com.arialyy.aria.core.upload.UploadEntity;
|
||||||
import com.arialyy.aria.orm.DbEntity;
|
import com.arialyy.aria.orm.DbEntity;
|
||||||
@@ -76,6 +77,10 @@ public class DeleteURecord implements IDeleteRecord {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UploadEntity entity = (UploadEntity) absEntity;
|
UploadEntity entity = (UploadEntity) absEntity;
|
||||||
|
|
||||||
|
// 删除下载的线程记录和任务记录
|
||||||
|
DbEntity.deleteData(ThreadRecord.class, "taskKey=? AND threadType=?", entity.getFilePath(),
|
||||||
|
String.valueOf(entity.getTaskType()));
|
||||||
DbEntity.deleteData(TaskRecord.class, "filePath=? AND taskType=?", entity.getFilePath(),
|
DbEntity.deleteData(TaskRecord.class, "filePath=? AND taskType=?", entity.getFilePath(),
|
||||||
String.valueOf(entity.getTaskType()));
|
String.valueOf(entity.getTaskType()));
|
||||||
|
|
||||||
|
|||||||
34
README.md
34
README.md
@@ -45,19 +45,19 @@ Aria有以下特点:
|
|||||||
|
|
||||||
## 引入库
|
## 引入库
|
||||||
[](https://github.com/AriaLyy/Aria/blob/master/LICENSE)
|
[](https://github.com/AriaLyy/Aria/blob/master/LICENSE)
|
||||||
[](https://github.com/AriaLyy/Aria)
|
[](https://github.com/AriaLyy/Aria)
|
||||||
[](https://github.com/AriaLyy/Aria)
|
[](https://github.com/AriaLyy/Aria)
|
||||||
[](https://github.com/AriaLyy/Aria)
|
[](https://github.com/AriaLyy/Aria)
|
||||||
[](https://github.com/AriaLyy/Aria)
|
[](https://github.com/AriaLyy/Aria)
|
||||||
[](https://github.com/AriaLyy/Aria)
|
[](https://github.com/AriaLyy/Aria)
|
||||||
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
implementation 'com.arialyy.aria:core:3.8.7'
|
implementation 'com.arialyy.aria:core:3.8.8'
|
||||||
annotationProcessor 'com.arialyy.aria:compiler:3.8.7'
|
annotationProcessor 'com.arialyy.aria:compiler:3.8.8'
|
||||||
implementation 'com.arialyy.aria:ftpComponent:3.8.7' # 如果需要使用ftp,请增加该组件
|
implementation 'com.arialyy.aria:ftpComponent:3.8.8' # 如果需要使用ftp,请增加该组件
|
||||||
implementation 'com.arialyy.aria:sftpComponent:3.8.7' # 如果需要使用ftp,请增加该组件
|
implementation 'com.arialyy.aria:sftpComponent:3.8.8' # 如果需要使用ftp,请增加该组件
|
||||||
implementation 'com.arialyy.aria:m3u8Component:3.8.7' # 如果需要使用m3u8下载功能,请增加该组件
|
implementation 'com.arialyy.aria:m3u8Component:3.8.8' # 如果需要使用m3u8下载功能,请增加该组件
|
||||||
```
|
```
|
||||||
|
|
||||||
如果你使用的是kotlin,请使用kotlin官方提供的方法配置apt,[kotlin kapt官方配置传送门](https://www.kotlincn.net/docs/reference/kapt.html)
|
如果你使用的是kotlin,请使用kotlin官方提供的方法配置apt,[kotlin kapt官方配置传送门](https://www.kotlincn.net/docs/reference/kapt.html)
|
||||||
@@ -138,17 +138,9 @@ protected void onCreate(Bundle savedInstanceState) {
|
|||||||
|
|
||||||
|
|
||||||
### 版本日志
|
### 版本日志
|
||||||
+ v_3.8.7 (2020/5/25)
|
+ v_3.8.8 (2020/6/7)
|
||||||
- 修复组合任务单个子任务失败后,重新恢复组合任务,组合任务状态变为完成的问题
|
- 修复设置了cancel(false),文件还是被删除的问题 https://github.com/AriaLyy/Aria/issues/686
|
||||||
- 修复40x错误,会继续重试并且无法重试成功的问题 https://github.com/AriaLyy/Aria/issues/619
|
- 修复错误url的下载任务,无法删除的问题 https://github.com/AriaLyy/Aria/issues/684
|
||||||
- 修复wait模式下,resume(true)无效问题
|
|
||||||
- 修复now模式下的一些问题 https://github.com/AriaLyy/Aria/issues/620
|
|
||||||
- 修复组任务,其中一个子任务在获取文件长度失败后,重新恢复组合任务,组合任务状态变为完成的问题 https://github.com/AriaLyy/Aria/issues/628
|
|
||||||
- 修复组任务中,其中一个子任务是30x地址,导致调度器无法出现该子任务状态的问题
|
|
||||||
- 增加组任务groupHash冲突检查 https://github.com/AriaLyy/Aria/issues/635
|
|
||||||
- 修复task.cancel(false)还是把本地文件删除的问题 https://github.com/AriaLyy/Aria/issues/646
|
|
||||||
- fix bug https://github.com/AriaLyy/Aria/issues/670
|
|
||||||
- fix bug https://github.com/AriaLyy/Aria/issues/664
|
|
||||||
|
|
||||||
[更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md)
|
[更多版本记录](https://github.com/AriaLyy/Aria/blob/master/DEV_LOG.md)
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<download>
|
<download>
|
||||||
|
|
||||||
<!--设置任务最大下载速度,0表示不限速,单位为:kb-->
|
<!--设置任务最大下载速度,0表示不限速,单位为:kb-->
|
||||||
<maxSpeed value="0"/>
|
<maxSpeed value="128"/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
多线程下载是否使用块下载模式,{@code true}使用,{@code false}不使用
|
多线程下载是否使用块下载模式,{@code true}使用,{@code false}不使用
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
<threadNum value="3"/>
|
<threadNum value="3"/>
|
||||||
|
|
||||||
<!--设置下载队列最大任务数, 默认为2-->
|
<!--设置下载队列最大任务数, 默认为2-->
|
||||||
<maxTaskNum value="2"/>
|
<maxTaskNum value="1"/>
|
||||||
|
|
||||||
<!--设置下载失败,重试次数,默认为10-->
|
<!--设置下载失败,重试次数,默认为10-->
|
||||||
<reTryNum value="5"/>
|
<reTryNum value="5"/>
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
<convertSpeed value="true"/>
|
<convertSpeed value="true"/>
|
||||||
|
|
||||||
<!--执行队列类型,见com.arialyy.aria.core.QueueMod,默认类型为wait-->
|
<!--执行队列类型,见com.arialyy.aria.core.QueueMod,默认类型为wait-->
|
||||||
<queueMod value="now"/>
|
<queueMod value="wait"/>
|
||||||
|
|
||||||
<!--进度更新更新间隔,默认1000毫秒-->
|
<!--进度更新更新间隔,默认1000毫秒-->
|
||||||
<updateInterval value="1000"/>
|
<updateInterval value="1000"/>
|
||||||
|
|||||||
@@ -55,10 +55,10 @@ public class HttpDownloadModule extends BaseViewModule {
|
|||||||
//String url = "http://fdfs.speedata.cn:9989/group1/M00/00/05/rBGFrl3fdAKAVJwfMtSa9R18wLU139.zip";
|
//String url = "http://fdfs.speedata.cn:9989/group1/M00/00/05/rBGFrl3fdAKAVJwfMtSa9R18wLU139.zip";
|
||||||
//String url = "http://9.9.9.28:8088/files/update.zip";
|
//String url = "http://9.9.9.28:8088/files/update.zip";
|
||||||
//String url = "https://ss1.baidu.com/-4o3dSag_xI4khGko9WTAnF6hhy/image/h%3D300/sign=a9e671b9a551f3dedcb2bf64a4eff0ec/4610b912c8fcc3cef70d70409845d688d53f20f7.jpg";
|
//String url = "https://ss1.baidu.com/-4o3dSag_xI4khGko9WTAnF6hhy/image/h%3D300/sign=a9e671b9a551f3dedcb2bf64a4eff0ec/4610b912c8fcc3cef70d70409845d688d53f20f7.jpg";
|
||||||
String url = "https://imtt.dd.qq.com/16891/apk/70BFFDB05AB8686F2A4CF3E07588A377.apk?fsname=com.tencent.tmgp.speedmobile_1.16.0.33877_1160033877.apk&csr=1bbd";
|
//String url = "https://imtt.dd.qq.com/16891/apk/70BFFDB05AB8686F2A4CF3E07588A377.apk?fsname=com.tencent.tmgp.speedmobile_1.16.0.33877_1160033877.apk&csr=1bbd";
|
||||||
//String url = "https://ss1.baidu.com/-4o3dSag_xI4khGko9WTAnF6hhy/image/h%3D300/sign=a9e671b9a551f3dedcb2bf64a4eff0ec/4610b912c8fcc3cef70d70409845d688d53f20f7.jpg";
|
//String url = "https://ss1.baidu.com/-4o3dSag_xI4khGko9WTAnF6hhy/image/h%3D300/sign=a9e671b9a551f3dedcb2bf64a4eff0ec/4610b912c8fcc3cef70d70409845d688d53f20f7.jpg";
|
||||||
//String filePath = AppUtil.getConfigValue(context, HTTP_PATH_KEY, defFilePath);
|
//String filePath = AppUtil.getConfigValue(context, HTTP_PATH_KEY, defFilePath);
|
||||||
//String url = "https://y.qq.com/download/import/QQMusic-import-1.2.1.zip";
|
String url = "https://y.qq.com/download/import/QQMusic-import-1.2.1.zip1";
|
||||||
//String url = "https://video-hkt1-1.xx.fbcdn.net/v/t42.9040-2/89465702_658301101378505_5469280744218034176_n.mp4?_nc_cat=107&_nc_sid=985c63&efg=eyJ2ZW5jb2RlX3RhZyI6ImxlZ2FjeV9zZCJ9&_nc_oc=AQmzYwQG9vccyqr7S44-cfHc4wJ9010O1nvspG2DPV4cTct1pLrjKl1e1UmOJV99bJw&_nc_ht=video-hkt1-1.xx&oh=49bd04435aaa8b4459b8d5cb7d1e7c79&oe=5E672E37";
|
//String url = "https://video-hkt1-1.xx.fbcdn.net/v/t42.9040-2/89465702_658301101378505_5469280744218034176_n.mp4?_nc_cat=107&_nc_sid=985c63&efg=eyJ2ZW5jb2RlX3RhZyI6ImxlZ2FjeV9zZCJ9&_nc_oc=AQmzYwQG9vccyqr7S44-cfHc4wJ9010O1nvspG2DPV4cTct1pLrjKl1e1UmOJV99bJw&_nc_ht=video-hkt1-1.xx&oh=49bd04435aaa8b4459b8d5cb7d1e7c79&oe=5E672E37";
|
||||||
//String url = "http://donuts.aigauss.com/doc_fPhW2DBGj3_1578932414.png";
|
//String url = "http://donuts.aigauss.com/doc_fPhW2DBGj3_1578932414.png";
|
||||||
String filePath = "/mnt/sdcard/update.mp4";
|
String filePath = "/mnt/sdcard/update.mp4";
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public void cancel(View v, AbsEntity entity) {
|
@Override public void cancel(View v, AbsEntity entity) {
|
||||||
Aria.download(this).load(mTaskId).cancel(true);
|
Aria.download(this).load(mTaskId).cancel(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ task clean(type: Delete) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
versionCode = 387
|
versionCode = 388
|
||||||
versionName = '3.8.7'
|
versionName = '3.8.8'
|
||||||
userOrg = 'arialyy'
|
userOrg = 'arialyy'
|
||||||
groupId = 'com.arialyy.aria'
|
groupId = 'com.arialyy.aria'
|
||||||
publishVersion = versionName
|
publishVersion = versionName
|
||||||
|
|||||||
Reference in New Issue
Block a user