Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix file path

Neeraj Gupta29925a910c87
diff --git a/pkg/remote_to_disk_album.go b/pkg/remote_to_disk_album.go
index cefb734a39..6253a3e4cc 100644
--- a/pkg/remote_to_disk_album.go
+++ b/pkg/remote_to_disk_album.go
@@ -38,6 +38,7 @@ func (c *ClICtrl) createLocalFolderForRemoteAlbums(ctx context.Context, account
continue
}
metaByID := albumIDToMetaMap[album.ID]
+
if metaByID != nil {
if strings.EqualFold(metaByID.AlbumName, album.AlbumName) {
//log.Printf("Skipping album %s as it already exists", album.AlbumName)
@@ -45,7 +46,7 @@ func (c *ClICtrl) createLocalFolderForRemoteAlbums(ctx context.Context, account
}
}
- albumFolderName := album.AlbumName
+ albumFolderName := filepath.Clean(album.AlbumName)
albumID := album.ID
if _, ok := folderToMetaMap[albumFolderName]; ok {
diff --git a/pkg/remote_to_disk_file.go b/pkg/remote_to_disk_file.go
index 51e8ef43e5..ced04945a4 100644
--- a/pkg/remote_to_disk_file.go
+++ b/pkg/remote_to_disk_file.go
@@ -116,7 +116,7 @@ func (c *ClICtrl) downloadEntry(ctx context.Context,
fileDiskMetadata := mapper.MapRemoteFileToDiskMetadata(file)
// Get the extension
extension := filepath.Ext(fileDiskMetadata.Title)
- baseFileName := strings.TrimSuffix(filepath.Base(fileDiskMetadata.Title), extension)
+ baseFileName := strings.TrimSuffix(filepath.Clean(filepath.Base(fileDiskMetadata.Title)), extension)
potentialDiskFileName := fmt.Sprintf("%s%s.json", baseFileName, extension)
count := 1
for diskInfo.IsMetaFileNamePresent(potentialDiskFileName) {