JYC333 / obsidian-attachment-name-formatting

Obsidian plugin that automatically rename attachment files' name
MIT License
47 stars 7 forks source link

bug in "Handle same attachment used in different notes" #29

Closed Lignaloes closed 10 months ago

Lignaloes commented 1 year ago

Whether I choose "default", "copy", or "NoChange",my attachments are renamed on every change using the default mode. I don't know if it's because the default attachment storage method I choose is "the specified folder in the current folder". In short, no matter which one I choose, the name and location of the attachment will be modified.

JYC333 commented 1 year ago

Hi, sorry for the late reply, I have tested with the setting "In subfolder under current folder". Each mode works fine for me, I don't see the bug you mention. Could you provide more details? Like the structure before and after renaming the attachments. You can also open "Logging Attachment Name Changes" option in plugin setting and provide that log.

joshualeduc commented 11 months ago

Just wanted to add that I am also seeing the default behavior no matter which option I select in the dropdown menu. My workspace is set to save everything to the folder _Assets/images. I created 4 blank notes. I paste in one ![[image]] line and hit enter. I then copy the new ![[image]] line and paste it in the next note. I did that for the four test notes. I'm using v2.1.5, first note and second note were used with "nochange", third and fourth note were used with "copy". Also everything runs twice even through I'm only pasting the title into the new note once.

First Note.md [12/11/2023, 2:04:49 AM]

Rename attachment _Assets/image/Notes_image_3.jpg to _Assets/image/First Note_image_1.jpg

First Note.md [12/11/2023, 2:04:49 AM]

Rename attachment _Assets/image/First Note_image_1.jpg to _Assets/image/First Note_image_1.jpg

Second Note.md [12/11/2023, 2:05:17 AM]

Rename attachment _Assets/image/First Note_image_1.jpg to _Assets/image/Second Note_image_1.jpg

Second Note.md [12/11/2023, 2:05:17 AM]

Rename attachment _Assets/image/Second Note_image_1.jpg to _Assets/image/Second Note_image_1.jpg

Third Note.md [12/11/2023, 2:06:04 AM]

Rename attachment _Assets/image/Second Note_image_1.jpg to _Assets/image/Third Note_image_1.jpg

Third Note.md [12/11/2023, 2:06:04 AM]

Rename attachment _Assets/image/Third Note_image_1.jpg to _Assets/image/Third Note_image_1.jpg

Fourth Note.md [12/11/2023, 2:06:23 AM]

Rename attachment _Assets/image/Third Note_image_1.jpg to _Assets/image/Fourth Note_image_1.jpg

Fourth Note.md [12/11/2023, 2:06:23 AM]

Rename attachment _Assets/image/Fourth Note_image_1.jpg to _Assets/image/Fourth Note_image_1.jpg

JYC333 commented 10 months ago

Hi, I found the bug and fix it in 2.1.6 now, the copy option should work again. For renaming running twice I might need to restructure a bit, but I believe it won't affect daily use at moment.

Thanks for reporting the bug!

JYC333 commented 10 months ago

It's not that difficult as I thought... Fixed in 2.1.7.