Implement actual file system renaming functionality with updated documentation
This commit is contained in:
parent
e3101006f2
commit
3a855ce64a
@ -40,7 +40,7 @@ MovieMapper is a desktop application designed for organizing and managing movie
|
|||||||
- Air dates
|
- Air dates
|
||||||
|
|
||||||
### 3. File Management
|
### 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 Tagging**: Mark files as extras or with commentary tags
|
||||||
- **File Untagging**: Click on already tagged files to remove the tag
|
- **File Untagging**: Click on already tagged files to remove the tag
|
||||||
- **File Organization**: Move files to "extras" folder for better organization
|
- **File Organization**: Move files to "extras" folder for better organization
|
||||||
|
|||||||
@ -174,6 +174,11 @@ function makeEditable(element) {
|
|||||||
console.log('File renamed successfully:', result.message);
|
console.log('File renamed successfully:', result.message);
|
||||||
// Update the file name in the UI to reflect the change
|
// Update the file name in the UI to reflect the change
|
||||||
element.textContent = element.textContent.trim();
|
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 {
|
} else {
|
||||||
console.error('Failed to rename file:', result.error);
|
console.error('Failed to rename file:', result.error);
|
||||||
// Revert to original name on failure
|
// Revert to original name on failure
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user