Skip to content

Commit

Permalink
Auto-skip if file name does not match
Browse files Browse the repository at this point in the history
  • Loading branch information
gaowanliang committed Apr 21, 2021
1 parent ef6de77 commit 7ed62fa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api/restore/upload/onedriveRecoverableRestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ func (rs *RestoreService) recoverableUpload(userID string, bearerToken string, c
//1. Get recoverable upload session for the current file path 获取当前文件路径的可压缩上载会话
uploadSessionData, err := rs.getUploadSession(userID, bearerToken, conflictOption, targetFolder, filePath)
if err != nil {
log.Panicf(locText("failToStore"), err)
sendMsg(fmt.Sprintf(locText("filenameFail"), filePath))
return nil
}

//2. Get the upload url returned as a response from the recoverable upload session above. 从上面的可压缩上载会话获取作为响应返回的上载url。
Expand Down
3 changes: 2 additions & 1 deletion api/restore/upload/onedriveRestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func (rs *RestoreService) SimpleUploadToOriginalLoc(userId string, bearerToken s
}

if err != nil {
log.Panicf(locText("failToStore"), err)
sendMsg(fmt.Sprintf(locText("filenameFail"), filePath))
return nil
}
if resp.Body != nil {
defer resp.Body.Close()
Expand Down
1 change: 1 addition & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ startToUpload = "`%s` start uploading, size:`%s`"
startToUpload1 = "start uploading to onedrive"
telegramSendError = "Telegram Send Error:%s"
existSkip = "Already exists, auto skip"
filenameFail="`%s` The file name has illegal characters and cannot be uploaded, please modify it and re-upload, it has been automatically skipped"
1 change: 1 addition & 0 deletions i18n/zh-CN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ startToUpload = "`%s` 开始上传,大小: `%s`"
startToUpload1 = "开始上传至OneDrive"
telegramSendError = "Telegram 发送错误:%s"
existSkip = "已存在,自动跳过"
filenameFail="`%s` 文件名有非法字符,无法上传,请修改后重新上传,已自动跳过"

0 comments on commit 7ed62fa

Please sign in to comment.