Move the image in VSCode file browser to a different folder.
Open mediaDb.json — new image location is updated in mediaDb.json, but all metadata is lost.
Expected behavior
When moving an image with metadata in VS Code file browser to another folder, image metadata should be retained in mediaDb.json.
**Describe the bug**
When moving an image with metadata from one folder into another, its metadata is lost in `mediaDb.json`.
` mediaDb.json` before moving:
```
{
".frontmatter": {
"assets": { "media": { "image.png": { "caption": "caption", "alt": "alt", "title": "title" } } }
}
}
```
` mediaDb.json` after moving to `new` folder:
```
{
".frontmatter": {
"assets": { "media": { "new": { "image.png": {} } } }
}
}
```
**To Reproduce**
Steps to reproduce the behavior:
1. Upload an image into a media folder.
2. Add metadata (alt text, caption).
4. Move the image in VSCode file browser to a different folder.
5. Open `mediaDb.json` — new image location is updated in `mediaDb.json`, but all metadata is lost.
**Expected behavior**
When moving an image with metadata in VS Code file browser to another folder, image metadata should be retained in `mediaDb.json`.
<!-- github-sync-id:1858081202 -->
Thanks, @polynook for opening an issue. I need to think about a way to re-map the media files and their metadata.
Thanks, @polynook for opening an issue. I need to think about a way to re-map the media files and their metadata.
<!-- github-comment-id:1719330282 -->
There was an issue in the move file listener. This will be fixed in the upcoming beta.
I also added a new unmapped files feature. When editing a file's metadata, a check will be performed against the metadata, which is not linked to any file with the same filename.
In the following recording you can see the updates:
The new unmapped media feature
The update which should happen on moving files (fixed)
There was an issue in the move file listener. This will be fixed in the upcoming beta.
I also added a new unmapped files feature. When editing a file's metadata, a check will be performed against the metadata, which is not linked to any file with the same filename.
In the following recording you can see the updates:
1. The new unmapped media feature
2. The update which should happen on moving files (fixed)
https://github.com/estruyf/vscode-front-matter/assets/2900833/9d8996a8-f4f7-4c5f-9028-aa609941b33b
<!-- github-comment-id:1719652035 -->
After checking the mediaDb.json before and after moving the file, the mediaDb.json remains unchanged — no entry is deleted nor added. I have to use the unmapped media feature for the changes to be reflected in the mediaDb.json.
Thanks for improvements, @estruyf.
I've been testing them and the unmapped media feature seems to work great, but the metadata is not being moved in my case.
https://github.com/estruyf/vscode-front-matter/assets/71569839/53f37282-5ca7-4482-9e6e-9bde28749765
After checking the `mediaDb.json` before and after moving the file, the `mediaDb.json` remains unchanged — no entry is deleted nor added. I have to use the unmapped media feature for the changes to be reflected in the `mediaDb.json`.
<!-- github-comment-id:1721124654 -->
Thanks @polynook for testing. It's good to see that at least the remapping works. ☺️
I will have to check if it would have anything to do with VSCode listeners on Windows.
Thanks @polynook for testing. It's good to see that at least the remapping works. ☺️
I will have to check if it would have anything to do with VSCode listeners on Windows.
<!-- github-comment-id:1721144702 -->
Just to add a bit more context, I'm running Front Matter inside a Debian 11 dev container in WSL 2. Maybe it'll be helpful.
Just to add a bit more context, I'm running Front Matter inside a Debian 11 dev container in WSL 2. Maybe it'll be helpful.
<!-- github-comment-id:1721161607 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Describe the bug
When moving an image with metadata from one folder into another, its metadata is lost in
mediaDb.json.mediaDb.jsonbefore moving:mediaDb.jsonafter moving tonewfolder:To Reproduce
Steps to reproduce the behavior:
mediaDb.json— new image location is updated inmediaDb.json, but all metadata is lost.Expected behavior
When moving an image with metadata in VS Code file browser to another folder, image metadata should be retained in
mediaDb.json.Thanks, @polynook for opening an issue. I need to think about a way to re-map the media files and their metadata.
There was an issue in the move file listener. This will be fixed in the upcoming beta.
I also added a new unmapped files feature. When editing a file's metadata, a check will be performed against the metadata, which is not linked to any file with the same filename.
In the following recording you can see the updates:
https://github.com/estruyf/vscode-front-matter/assets/2900833/9d8996a8-f4f7-4c5f-9028-aa609941b33b
Thanks for improvements, @estruyf.
I've been testing them and the unmapped media feature seems to work great, but the metadata is not being moved in my case.
https://github.com/estruyf/vscode-front-matter/assets/71569839/53f37282-5ca7-4482-9e6e-9bde28749765
After checking the
mediaDb.jsonbefore and after moving the file, themediaDb.jsonremains unchanged — no entry is deleted nor added. I have to use the unmapped media feature for the changes to be reflected in themediaDb.json.Thanks @polynook for testing. It's good to see that at least the remapping works. ☺️
I will have to check if it would have anything to do with VSCode listeners on Windows.
Just to add a bit more context, I'm running Front Matter inside a Debian 11 dev container in WSL 2. Maybe it'll be helpful.
Think I know what can cause it, should be fixed in the next beta.
Beta has been released.
Phenomenal work, @estruyf! Works well now. Thanks.