Skip to content

Assets saved in wrong folder #16

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

Closed
netfrettchen opened this issue Mar 8, 2022 · 6 comments
Closed

Assets saved in wrong folder #16

netfrettchen opened this issue Mar 8, 2022 · 6 comments

Comments

@netfrettchen
Copy link

netfrettchen commented Mar 8, 2022

Hi, I really like the idea of having attachments ordered in folders that match notes name.
I tried this plugin without success.

v 0.0.7
Setting:
Location for new attachments: assets/${filename}
Automatic rename [...]: Checked

Problem:
The first attachment is not saved into the requested folder.

Reproducable behaviour:

  • copy first attachment into note
  • => folder assets/${filename} gets created, but attachment is saved in obsidian workspace root
  • copy another attachment into note
  • => attachment is copied into assets/${filename} as it should be

... if it is of any importance: I am using Obsidian on Win10, Workspace is located on mapped NAS

@RainCat1998
Copy link
Owner

I have known this bug when I was testing the latest release. But unfortunately it cannot be fixed easily. I tried to fix another bug in v 0.0.6(#8 ), and I found there's some logical issues with obsidian "drag & drop" API callback.
Obsidian first starts a pending file operation(which contains target file path) , and then invoke the callback in my plugin.
This is why changing settings doesn't affect the first copy operation.

@netfrettchen
Copy link
Author

Would it be possible to move the file when your plugin is called?

@RainCat1998
Copy link
Owner

Would it be possible to move the file when your plugin is called?

It makes the plugin more complicated. If you use ctrl-c & ctrl-v to copy files, everything works fine.

@netfrettchen
Copy link
Author

Sure, but that is not what one expects when using your Plugin. Usecase it dropping the file into a note and forget about it without having to think of moving it around manually.
Nevertheless, thanks for your work and explanations.

@RainCat1998
Copy link
Owner

If obsidian fix it, I will update my plugin in the first time.

@RainCat1998
Copy link
Owner

Using relative path(start with "./") works fine. It's a bug that is hard to fix because of obsidian's weird behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants