diff --git a/PROJECT_OVERVIEW.md b/PROJECT_OVERVIEW.md index e5dccc4..34308cf 100644 --- a/PROJECT_OVERVIEW.md +++ b/PROJECT_OVERVIEW.md @@ -40,7 +40,7 @@ MovieMapper is a desktop application designed for organizing and managing movie - Air dates ### 3. File Management -- **File Renaming**: Click on file names to rename them directly in the interface +- **File Renaming**: Click on file names to rename them directly in the interface (changes persist to actual file system) - **File Tagging**: Mark files as extras or with commentary tags - **File Untagging**: Click on already tagged files to remove the tag - **File Organization**: Move files to "extras" folder for better organization diff --git a/renderer.js b/renderer.js index fcb87d4..11121ae 100644 --- a/renderer.js +++ b/renderer.js @@ -174,6 +174,11 @@ function makeEditable(element) { console.log('File renamed successfully:', result.message); // Update the file name in the UI to reflect the change element.textContent = element.textContent.trim(); + + // Also update the data attribute to reflect the new path + const oldPath = element.dataset.filePath; + const newPath = oldPath.substring(0, oldPath.lastIndexOf(path.sep) + 1) + element.textContent.trim(); + element.dataset.filePath = newPath; } else { console.error('Failed to rename file:', result.error); // Revert to original name on failure