Fix bug where picture files where not uploaded at all when encryption and cloud storage was active as well as SaveToLocal #247

This commit is contained in:
Marc Ole Bulling
2025-03-24 21:33:43 +01:00
parent 450a25ad7a
commit 0fba1230f7
2 changed files with 11 additions and 1 deletions
+5 -1
View File
@@ -194,7 +194,11 @@ func NewFileFromChunk(chunkId string, fileHeader chunking.FileHeader, userId int
fileToMove = tempFile
}
processingstatus.Set(chunkId, processingstatus.StatusUploading, models.File{}, nil)
err = filesystem.ActiveStorageSystem.MoveToFilesystem(fileToMove, metaData)
if metaData.IsLocalStorage() {
err = filesystem.GetLocal().MoveToFilesystem(fileToMove, metaData)
} else {
err = filesystem.ActiveStorageSystem.MoveToFilesystem(fileToMove, metaData)
}
if err != nil {
return models.File{}, err
}
@@ -42,5 +42,11 @@ func SetLocal() {
ActiveStorageSystem = dataFilesystem
}
// GetLocal gets the local filesystem, regardless of what filesystem is used by default. This is required when encrypted
// pictures are stored locally instead of the cloud to support hotlinking
func GetLocal() interfaces.System {
return dataFilesystem
}
// isUnitTesting is only set to true when testing, to avoid login with aws
var isUnitTesting = false