修复now模式下的一些问题 https://github.com/AriaLyy/Aria/issues/620
修复wait模式下,resume(true)无效问题
This commit is contained in:
@@ -130,13 +130,17 @@ public class RecordHelper {
|
||||
/*
|
||||
* 检查记录文件
|
||||
*/
|
||||
if (blockFileLen == threadRect) {
|
||||
if (blockFileLen == threadRect && blockFileLen != 0) {
|
||||
ALog.i(TAG, String.format("分块【%s】已完成,更新记录", temp.getPath()));
|
||||
tr.startLocation = blockFileLen;
|
||||
tr.isComplete = true;
|
||||
} else if (tr.startLocation != realLocation) { // 处理记录小于分块文件长度的情况
|
||||
ALog.i(TAG, String.format("修正分块【%s】的进度记录为:%s", temp.getPath(), realLocation));
|
||||
tr.startLocation = realLocation;
|
||||
}else {
|
||||
ALog.i(TAG, String.format("修正分块【%s】的进度记录为:%s", temp.getPath(), realLocation));
|
||||
tr.startLocation = realLocation;
|
||||
tr.isComplete = false;
|
||||
}
|
||||
} else {
|
||||
ALog.i(TAG, String.format("分块【%s】已完成", temp.getPath()));
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.arialyy.aria.core.manager.ThreadTaskManager;
|
||||
import com.arialyy.aria.core.task.IThreadTask;
|
||||
import com.arialyy.aria.core.wrapper.AbsTaskWrapper;
|
||||
import com.arialyy.aria.exception.AriaException;
|
||||
import com.arialyy.aria.util.ALog;
|
||||
import com.arialyy.aria.util.FileUtil;
|
||||
import java.io.File;
|
||||
|
||||
@@ -99,6 +100,9 @@ public class NormalLoader<T extends AbsTaskWrapper> extends AbsNormalLoader<T> {
|
||||
}
|
||||
|
||||
protected void startThreadTask() {
|
||||
if (isBreak()){
|
||||
return;
|
||||
}
|
||||
|
||||
if (getListener() instanceof IDLoadListener) {
|
||||
((IDLoadListener) getListener()).onPostPre(getEntity().getFileSize());
|
||||
|
||||
@@ -93,6 +93,10 @@ public final class SubLoader implements ILoader, ILoaderVisitor {
|
||||
}
|
||||
|
||||
private void handlerTask() {
|
||||
if (isBreak()){
|
||||
return;
|
||||
}
|
||||
|
||||
record = recordHandler.getRecord(wrapper.getEntity().getFileSize());
|
||||
if (record.threadRecords != null
|
||||
&& !TextUtils.isEmpty(record.filePath)
|
||||
|
||||
Reference in New Issue
Block a user