dy-sh / obsidian-consistent-attachments-and-links

Obsidian plugin. Move note with attachments.
MIT License
202 stars 20 forks source link

Plugin appears to be broken since update? #83

Open Tesgin opened 4 months ago

Tesgin commented 4 months ago

Plugin no longer working: when I move markdown files to a new folder the links move with it to the user-defined _resource folder, but the links in the note are not properly updated and images can no longer be found.

Didn't used to do that. I'm noticing it since the update 2 days ago

Tesgin commented 4 months ago

Update. By experimenting i found out more details on the issue. IDK that it's the update, but it has to do with moving notes that were imported from Evernote.

The problem is that evernote, when imported, places attachments in a folder in resources with the same name as the note, EXCEPT that every space is replaced by an underscore. When the note moves the attachments are moved to a folder with the same name as the note (in the resources directory) which removes the underscores. The links in the original note are not updated, however: they point to an attachment folder that includes the underscore.

Is this something that can be fixed?

mnaoumov commented 4 months ago

@Tesgin can you provide a copy of the vault where you can reproduce the issue, so I can reproduce it?

mnaoumov commented 4 months ago

@Tesgin do you have Update Links setting enabled?

Tesgin commented 4 months ago

I do not

mnaoumov commented 4 months ago

@Tesgin if you don't have this setting enabled, then the links update is the responsibility of Obsidian itself and the plugin has nothing to do with it

Tesgin commented 4 months ago

@mnaoumov Thanks for this.

Here's a wetransfer link to download the vault. Not the whole vault but just a handful of folders to demo: https://we.tl/t-heEiAL6qd6

Re: the update links thing, my understanding is that (per the plugin instructions) it's the opposite, that when this is disabled, that gives the plugin the responsibility for updating links:

Required Obsidian settings for the plugin to work properly:

"Files & Links > Automatically update internal links": disabled. The plugin itself is responsible for updating the links. When Obsidian shows a dialog asking to update links, refuse.

mnaoumov commented 4 months ago

@Tesgin I meant the setting of the current plugin, not the Obsidian one you refer to

Tesgin commented 4 months ago

I just realized I misunderstood what you are saying. You are correct. I misspoke. In the plugin, yes, I do have that enabled. Under "Files and Links" I have that disabled. That was my quote above

Tesgin commented 4 months ago

Yes, in the plugin I have Update Links enabled

DG0lden commented 1 month ago

This problem affects me as well: attachments from Evernote are collected in each notes' personal folder under _resources. They are not all moved to global "attachments" sub-folder of my current folder as I expect. Some of them are moved and some of them are not. I don't recognize the pattern. Empty folders under _resources are also not deleted.

Plugin settings are:

{
  "moveAttachmentsWithNote": true,
  "deleteAttachmentsWithNote": true,
  "updateLinks": true,
  "deleteEmptyFolders": true,
  "deleteExistFilesWhenMoveNote": true,
  "changeNoteBacklinksAlt": false,
  "ignoreFolders": [
    ".git/",
    ".obsidian/"
  ],
  "ignoreFiles": [
    "consistency\\-report\\.md"
  ],
  "ignoreFilesRegex": [
    {}
  ],
  "attachmentsSubfolder": "attachments",
  "consistencyReportFile": "consistency-report.md",
  "useBuiltInObsidianLinkCaching": false
}
eemq commented 1 month ago

Any update on a possible fix? Plugin is not working for me either :(

My console log has this error:

[Consistent Attachments and Links: ]
(plugin:consistent-attachments-and-links:1880 Consistent Attachments and Links:)

SystemError [ERR_FS_EISDIR]: Path is a directory: rm returned EISDIR (is a directory) 
/Users/my.name/Library/Mobile Documents/iCloud~md~obsidian/Documents/my_notes/1. Personal/_inbox/_resources

eval @ plugin:consistent-attachments-and-links:1880
rejected @ plugin:consistent-attachments-and-links:24
Promise.then (async)
step @ plugin:consistent-attachments-and-links:25
fulfilled @ plugin:consistent-attachments-and-links:23
Promise.then (async)
step @ plugin:consistent-attachments-and-links:25
fulfilled @ plugin:consistent-attachments-and-links:23
Promise.then (async)
step @ plugin:consistent-attachments-and-links:25
fulfilled @ plugin:consistent-attachments-and-links:23
Promise.then (async)
step @ plugin:consistent-attachments-and-links:25
fulfilled @ plugin:consistent-attachments-and-links:23
Promise.then (async)
step @ plugin:consistent-attachments-and-links:25
fulfilled @ plugin:consistent-attachments-and-links:23
eemq commented 1 month ago

Plugin no longer working: when I move markdown files to a new folder the links move with it to the user-defined _resource folder, but the links in the note are not properly updated and images can no longer be found.

Didn't used to do that. I'm noticing it since the update 2 days ago

Plugin no longer working: when I move markdown files to a new folder the links move with it to the user-defined _resource folder, but the links in the note are not properly updated and images can no longer be found.

Didn't used to do that. I'm noticing it since the update 2 days ago

@Tesgin Did you mean that "the images move with it to the user-defined _resource folder" but that links are not updating in the note itself?? Because this is what's happening to me. @mnaoumov please see error above that i captured from my console logs. Hope it can provide some insights to how to resolve this issue.