From 8340bb779ccb7c8723959f290b011fee18d351a2 Mon Sep 17 00:00:00 2001 From: iikira <2571583272@qq.com> Date: Sun, 26 Aug 2018 11:39:47 +0800 Subject: [PATCH] bugfix --- .github/RELEASE_TEMPLATE.md | 4 ++-- README.md | 2 ++ baidupcs/cloud_dl.go | 2 +- internal/pcsfunctions/pcsupload/upload_database.go | 13 +++++++------ main.go | 1 + 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/RELEASE_TEMPLATE.md b/.github/RELEASE_TEMPLATE.md index 350391fe..5a20f176 100644 --- a/.github/RELEASE_TEMPLATE.md +++ b/.github/RELEASE_TEMPLATE.md @@ -27,10 +27,10 @@ * 移动设备: 请选择对应的系统(android, darwin(ios系统)), 对应的CPU架构 (一般情况下是 arm, 除了少数手机的CPU架构要选 amd, 例如联想K800, 联想K900等), 对应的CPU或操作系统位数 (详见上表), 下载. - 注意: Android5.0 以上的设备请不要下载使用linux版本的, 否则网络访问可能会出现问题. - ## 注意 +Android 5.0 以上的设备请不要下载使用linux版本的, 否则网络请求可能会出现问题. + 相关的关键词, 均能在文件名中找到. 文件格式均为zip压缩包格式, 切勿未解压程序就直接运行!! 程序解压之后才可以正常使用. diff --git a/README.md b/README.md index c5ffc248..404f19aa 100644 --- a/README.md +++ b/README.md @@ -582,6 +582,8 @@ BaiduPCS-Go od 离线下载支持http/https/ftp/电驴/磁力链协议 +离线下载同时进行的任务数量有限, 超出限制的部分将无法添加. + ### 添加离线下载任务 ``` BaiduPCS-Go offlinedl add -path=<离线下载文件保存的路径> 资源地址1 地址2 ... diff --git a/baidupcs/cloud_dl.go b/baidupcs/cloud_dl.go index 5ab5a565..35ae9421 100644 --- a/baidupcs/cloud_dl.go +++ b/baidupcs/cloud_dl.go @@ -158,7 +158,7 @@ func (pcs *BaiduPCS) cloudDlQueryTask(op string, taskIDs []int64) (cl CloudDlTas PCSErrInfo: errInfo, } - pcsError = handleJSONParse(op, dataReadCloser, &taskInfo) + pcsError = handleJSONParse(OperationCloudDlQueryTask, dataReadCloser, &taskInfo) if pcsError != nil { return } diff --git a/internal/pcsfunctions/pcsupload/upload_database.go b/internal/pcsfunctions/pcsupload/upload_database.go index a74f3710..8bf4a689 100644 --- a/internal/pcsfunctions/pcsupload/upload_database.go +++ b/internal/pcsfunctions/pcsupload/upload_database.go @@ -163,22 +163,23 @@ func (ud *UploadingDatabase) Search(meta *checksum.LocalFileMeta) *uploader.Inst } func (ud *UploadingDatabase) clearModTimeChange() { - for k, uploading := range ud.UploadingList { + for i := 0; i < len(ud.UploadingList); i++ { + uploading := ud.UploadingList[i] if uploading.LocalFileMeta == nil { continue } info, err := os.Stat(uploading.LocalFileMeta.Path) if err != nil { - ud.deleteIndex(k) - k-- - pcsUploadVerbose.Infof("clear invalid file path: %s\n", uploading.LocalFileMeta.Path) + ud.deleteIndex(i) + i-- + pcsUploadVerbose.Warnf("clear invalid file path: %s, err: %s\n", uploading.LocalFileMeta.Path, err) continue } if uploading.LocalFileMeta.ModTime != info.ModTime().Unix() { - ud.deleteIndex(k) - k-- + ud.deleteIndex(i) + i-- pcsUploadVerbose.Infof("clear modified file path: %s\n", uploading.LocalFileMeta.Path) continue } diff --git a/main.go b/main.go index 35ef54c8..15119448 100644 --- a/main.go +++ b/main.go @@ -1420,6 +1420,7 @@ func main() { Aliases: []string{"clouddl", "od"}, Usage: "离线下载", Description: `支持http/https/ftp/电驴/磁力链协议 + 离线下载同时进行的任务数量有限, 超出限制的部分将无法添加. 示例: