Fix file path

This commit is contained in:
Neeraj Gupta 2023-10-24 18:05:37 +05:30
parent 0918412b35
commit 29925a910c
2 changed files with 3 additions and 2 deletions

View file

@ -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 {

View file

@ -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) {