From 1845c261c6946ff8dd10d0340ef5722d235cccaa Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Mon, 24 Jul 2023 08:56:21 +0200 Subject: [PATCH] protondrive: fix missing file sha1 and appstring issues (#7163) --- backend/protondrive/protondrive.go | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/backend/protondrive/protondrive.go b/backend/protondrive/protondrive.go index a2f003fa2..2f65264c5 100644 --- a/backend/protondrive/protondrive.go +++ b/backend/protondrive/protondrive.go @@ -7,7 +7,6 @@ import ( "io" "log" "path" - "runtime" "strings" "time" @@ -48,29 +47,12 @@ const ( var ( ErrCanNotUploadFileWithUnknownSize = errors.New("proton Drive can't upload files with unknown size") ErrCanNotPurgeRootDirectory = errors.New("can't purge root directory") - ErrFileSHA1Missing = errors.New("file sha1 digest not found") // for the auth/deauth handler _mapper configmap.Mapper _saltedKeyPass string ) -func getAPIOS() string { - switch runtime.GOOS { - case "darwin": - return "macos" - - case "linux": - return "linux" - - case "windows": - return "windows" - - default: - return "linux" - } -} - // Register with Fs func init() { fs.Register(&fs.RegInfo{ @@ -117,12 +99,9 @@ size, will fail to operate properly`, The app version string indicates the client that is currently performing the API request. This information is required and will be sent with every -API request. - -Looks like using [OS]-drive (e.g. windows-drive) prefix will spare us from -getting aggressive human verification blocking.`, +API request.`, Advanced: true, - Default: getAPIOS() + "-drive@1.0.0-alpha.1+rclone", + Default: "macos-drive@1.0.0-alpha.1+rclone", }, { Name: "replace_existing_draft", Help: `Create a new revision when filename conflict is detected @@ -810,7 +789,8 @@ func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) { } if fileSystemAttrs == nil || fileSystemAttrs.Digests == "" { - return "", ErrFileSHA1Missing + fs.Debugf(o, "file sha1 digest missing") + return "", nil } return fileSystemAttrs.Digests, nil }