mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Fix issue of trying to create the root folder online (#3403)
* Fix issue of trying to create the root folder online (which is denoted by a '.') as this will never be possible.
This commit is contained in:
parent
298e8896b3
commit
b6fa6f8fe4
2 changed files with 20 additions and 1 deletions
15
src/sync.d
15
src/sync.d
|
|
@ -7907,7 +7907,20 @@ class SyncEngine {
|
|||
displayFunctionProcessingStart(thisFunctionName, logKey);
|
||||
}
|
||||
|
||||
// Log what we are doing
|
||||
// Is this a valid path to create?
|
||||
// We need to avoid this sort of error:
|
||||
//
|
||||
// OneDrive generated an error when creating this path: .
|
||||
|
||||
// ERROR: Microsoft OneDrive API returned an error with the following message:
|
||||
// Error Message: HTTP request returned status code 400 (Bad Request)
|
||||
// Error Reason: Invalid request
|
||||
// Error Code: invalidRequest
|
||||
// Error Timestamp: 2025-08-01T21:08:26
|
||||
// API Request ID: dca77bd6-1e9a-432a-bc6c-1c6b5380745d
|
||||
if (isRootEquivalent(thisNewPathToCreate)) return;
|
||||
|
||||
// Log what path we are attempting to create online
|
||||
if (verboseLogging) {addLogEntry("OneDrive Client requested to create this directory online: " ~ thisNewPathToCreate, ["verbose"]);}
|
||||
|
||||
// Function variables
|
||||
|
|
|
|||
|
|
@ -1396,6 +1396,12 @@ bool hasSHA256HashResume(const ref JSONValue item) {
|
|||
return ("sha256Hash" in item["onlineHash"]) != null;
|
||||
}
|
||||
|
||||
// Test if a path is the equivalent of root '.'
|
||||
bool isRootEquivalent(string inputPath) {
|
||||
auto normalisedPath = buildNormalizedPath(inputPath);
|
||||
return normalisedPath == "." || normalisedPath == "";
|
||||
}
|
||||
|
||||
// Convert bytes to GB
|
||||
string byteToGibiByte(ulong bytes) {
|
||||
if (bytes == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue