Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

视频下载完成后,任务状态不对 #388

Closed
tenda2014 opened this issue Apr 27, 2019 · 15 comments

Comments

Projects
None yet
3 participants
@tenda2014
Copy link

commented Apr 27, 2019

最新3.6.3版本
下载视频完成后,进度回调到最后一步,也就是95左右,最后百分百不走了,然后任务状态就会变成3(等待)。是否完成也是false,但是taskComplete是走了的。
这是我输出的log日志:
manger.state:5 2019-04-27 15:14:16.160 15581-15581/com.lnkj.todayvideo E/aria: ariaDownLoad start 2019-04-27 15:14:16.165 15581-15581/com.lnkj.todayvideo E/aria: p:0 speed:0.0b/s length:0 2019-04-27 15:14:17.165 15581-15581/com.lnkj.todayvideo E/aria: p:17 speed:831.74kb/s length:851699 2019-04-27 15:14:18.170 15581-15581/com.lnkj.todayvideo E/aria: p:27 speed:520.00kb/s length:532480 2019-04-27 15:14:18.763 15581-15581/com.lnkj.todayvideo E/aria: status nomal:true status high:true 2019-04-27 15:14:18.767 15581-15581/com.lnkj.todayvideo E/aria: manger.state:4 2019-04-27 15:14:19.168 15581-15581/com.lnkj.todayvideo E/aria: p:38 speed:504.00kb/s length:516096 2019-04-27 15:14:20.172 15581-15581/com.lnkj.todayvideo E/aria: p:51 speed:624.00kb/s length:638976 2019-04-27 15:14:21.174 15581-15581/com.lnkj.todayvideo E/aria: p:61 speed:512.00kb/s length:524288 2019-04-27 15:14:22.197 15581-15581/com.lnkj.todayvideo E/aria: p:70 speed:416.00kb/s length:425984 2019-04-27 15:14:23.196 15581-15581/com.lnkj.todayvideo E/aria: p:82 speed:592.00kb/s length:606208 2019-04-27 15:14:24.200 15581-15581/com.lnkj.todayvideo E/aria: p:94 speed:560.00kb/s length:573440 2019-04-27 15:14:24.776 15581-15581/com.lnkj.todayvideo E/aria: taskComplete 2019-04-27 15:14:31.713 15581-15581/com.lnkj.todayvideo E/aria: status nomal:true status high:true 2019-04-27 15:14:31.725 15581-15581/com.lnkj.todayvideo E/aria: manger.state:3 2019-04-27 15:14:33.802 15581-15581/com.lnkj.todayvideo E/aria: status nomal:true status high:true 2019-04-27 15:14:33.807 15581-15581/com.lnkj.todayvideo E/aria: manger.state:3
很明显最后一步没有修改完成状态。
我现在需要这个完成状态,请问还有其他方法可以判断已经下载完成了么?

@tenda2014

This comment has been minimized.

Copy link
Author

commented Apr 27, 2019

还有,我使用的是单线程下载

@dingyong666

This comment has been minimized.

Copy link

commented Apr 27, 2019

同样的问题

@tenda2014

This comment has been minimized.

Copy link
Author

commented Apr 28, 2019

同样的问题

是我的问题,我判断错了,我那个判断是判断的任务状态,下载完了,任务就应该是等待状态,我用获取实体就是正确的了,实体里有当前状态是完成的。
Aria.download(this).getDownloadTask(hasDownloadUrl)这个是任务状态,不应该用这个,我之前用的是这个。
Aria.download(this).getDownloadEntity(hasDownloadUrl)这个是实体状态,应该用这个,这个是争取的。

@AriaLyy

This comment has been minimized.

Copy link
Owner

commented Apr 28, 2019

这是一个问题,最好使用回调中的task
image

@AriaLyy

This comment has been minimized.

Copy link
Owner

commented Apr 28, 2019

看了下代码,这是历史遗留问题,后面会把这api移除。从3.6开始,任务是不会保存到数据库了。

@tenda2014

This comment has been minimized.

Copy link
Author

commented Apr 28, 2019

谢谢,解决了,但我是需要在下载开始前判断是否已经下载完成了的,所以不能在这里判断。
还有我想请问下,我发现当我从下载文件夹删掉下载的视频后,数据库中的数据不会去改变啊,还是之前的状态。也就是没有去检查文件是否存在是不?

@AriaLyy

This comment has been minimized.

Copy link
Owner

commented Apr 28, 2019

下载之前会检查文件的,如果文件不存在了会重新下载,状态会被重置

@AriaLyy

This comment has been minimized.

Copy link
Owner

commented Apr 28, 2019

状态的改变需要调用下载触发的,你自己删除文件,框架是不知道的。

@dingyong666

This comment has been minimized.

Copy link

commented Apr 28, 2019

大的视频下载完成后 再获取状态 刷新控件显示是 等待状态,不是完成状态,现在我是 加了个 判断进度 是不是 100

@AriaLyy

This comment has been minimized.

Copy link
Owner

commented Apr 28, 2019

@dingyong666 使用的是哪个api?

@dingyong666

This comment has been minimized.

Copy link

commented Apr 28, 2019

switch (downloadTarget.getTaskState()) {
case STATE_WAIT:
if (item.getPercent() == 100) {
btnDownload.setText("打开");
} else {
btnDownload.setText("STATE_WAIT");
}
break;

AriaLyy added a commit that referenced this issue Apr 29, 2019

fix bug #379 #388
移除`getDownloadTask(String url)`、`getGroupTask(List<String>urls)`、`getFtpDirTask(String path)`等获取任务的api
修复使用`Content-Disposition`的文件名时,第一次下载无法重命名文件的问题
修复使用`Content-Disposition`的文件名时,多次重命名文件的问题
@AriaLyy

This comment has been minimized.

Copy link
Owner

commented Apr 30, 2019

@dingyong666 升级3.6.4_dev_2,这个版本修复了这个问题

@dingyong666

This comment has been minimized.

Copy link

commented Apr 30, 2019

@AiraLyy 牛皮!

@dingyong666

This comment has been minimized.

Copy link

commented Apr 30, 2019

Could not resolve com.arialyy.aria:aria-core:3.6.4_dev_2

@AriaLyy

This comment has been minimized.

Copy link
Owner

commented May 1, 2019

@tenda2014 检查你的as代理配置,我这测试是可以的
image

@AriaLyy AriaLyy closed this May 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.