Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Scenes Metadata cache is empty after Obsidian restart #264

Open
gasparschott opened this issue Aug 11, 2024 · 1 comment
Open

[Bug]: Scenes Metadata cache is empty after Obsidian restart #264

gasparschott opened this issue Aug 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gasparschott
Copy link

Versions
Longform version: 2.0.7
Obsidian version: 1.7.0
OS: macOS

I am working to make Longform compatible with my plugin, Continuous Mode. I have added a CM context menu item to allow the user to open Longform projects and scenes in Continuous Mode. To do this I need to access the Longform metadata cache. This worked fine until recently, when I revisited the code for some additional testing. Now there is the following problem:

Describe the bug
Calling this.app.metadataCache.getFileCache(longform_index_file).frontmatter.longform.scenes returns an empty array after restarting Obsidian.
Changing the project structure (e.g., moving a scene) updates the metadata to correctly reflect the new structure.
But after another restart, the scenes are again missing from the metadata.
The project itself loads correctly in Obisidan, with all scenes intact and in order.

Screenshots
Project structure:
longform-project

Correct metadata:
longform-correct-metadata

Incorrect metadata after restart:
longform-incorrect-metadata-after-restart

@gasparschott gasparschott added the bug Something isn't working label Aug 11, 2024
@gasparschott
Copy link
Author

gasparschott commented Aug 11, 2024

I see that I can get the list of scenes via workspace.getLeavesOfType('VIEW_TYPE_LONGFORM_EXPLORER')[0].view.explorerView.$$.ctx[1].scenes
Edit: But this only returns the list of scenes with indent value and title, whereas the metadatacache info is far more complete and useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant