mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-06 00:03:38 +00:00
Compare commits
3 Commits
3845962996
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2def0161b3 | ||
|
|
df76bd0a34 | ||
|
|
065ae50868 |
@@ -2263,7 +2263,7 @@ func main() {
|
||||
app.Name = "duplicacy"
|
||||
app.HelpName = "duplicacy"
|
||||
app.Usage = "A new generation cloud backup tool based on lock-free deduplication"
|
||||
app.Version = "3.2.4" + " (" + GitCommit + ")"
|
||||
app.Version = "3.2.5" + " (" + GitCommit + ")"
|
||||
|
||||
// Exit with code 2 if an invalid command is provided
|
||||
app.CommandNotFound = func(context *cli.Context, command string) {
|
||||
|
||||
@@ -456,7 +456,7 @@ func (client *OneDriveClient) MoveFile(path string, parent string) error {
|
||||
url := client.APIURL + "/root:/" + path
|
||||
|
||||
parentReference := make(map[string]string)
|
||||
parentReference["path"] = "/root:/" + parent
|
||||
parentReference["path"] = "/drive/root:/" + parent
|
||||
|
||||
parameters := make(map[string]interface{})
|
||||
parameters["parentReference"] = parentReference
|
||||
|
||||
@@ -204,7 +204,7 @@ func (storage *OneDriveStorage) GetFileInfo(threadIndex int, filePath string) (e
|
||||
|
||||
// DownloadFile reads the file at 'filePath' into the chunk.
|
||||
func (storage *OneDriveStorage) DownloadFile(threadIndex int, filePath string, chunk *Chunk) (err error) {
|
||||
readCloser, _, err := storage.client.DownloadFile(storage.storageDir + "/" + filePath)
|
||||
readCloser, _, err := storage.client.DownloadFile(storage.storageDir + "/" + storage.convertFilePath(filePath))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"regexp"
|
||||
|
||||
"github.com/ncw/swift/v2"
|
||||
)
|
||||
@@ -42,13 +43,6 @@ func CreateSwiftStorage(storageURL string, key string, threads int) (storage *Sw
|
||||
}
|
||||
}
|
||||
|
||||
// Take out the user name if there is one
|
||||
if strings.Contains(storageURL, "@") {
|
||||
userAndURL := strings.Split(storageURL, "@")
|
||||
arguments["user"] = userAndURL[0]
|
||||
storageURL = userAndURL[1]
|
||||
}
|
||||
|
||||
// The version is used to split authURL and container/path
|
||||
versions := []string{"/v1/", "/v1.0/", "/v2/", "/v2.0/", "/v3/", "/v3.0/", "/v4/", "/v4.0/"}
|
||||
storageDir := ""
|
||||
@@ -60,6 +54,17 @@ func CreateSwiftStorage(storageURL string, key string, threads int) (storage *Sw
|
||||
}
|
||||
}
|
||||
|
||||
// Take out the user name if there is one
|
||||
if strings.Contains(storageURL, "@") {
|
||||
// Use regex to split the username and the rest of the URL
|
||||
lineRegex := regexp.MustCompile(`^(.+)@([^@]+)$`)
|
||||
match := lineRegex.FindStringSubmatch(storageURL)
|
||||
if match != nil {
|
||||
arguments["user"] = match[1]
|
||||
storageURL = match[2]
|
||||
}
|
||||
}
|
||||
|
||||
// If no container/path is specified, find them from the arguments
|
||||
if storageDir == "" {
|
||||
storageDir = arguments["storage_dir"]
|
||||
|
||||
Reference in New Issue
Block a user