Git Product home page Git Product logo

obsidian-attachment-management's Introduction

obsidian-attachment-management's People

Contributors

dependabot[bot] avatar lisandra-dev avatar trganda avatar viethung0823 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

obsidian-attachment-management's Issues

[FR]: Overrides path by extensions

The overrides is great, but it doesn't difference between pdf and image, for example (if we handle all attachment). It will be cool to have a button to set custom path by extension in the settings and overrides settings.

The idea is to add a plus button, that populate a list. In the creating path, check the extension. If the extension exist in the list of the overrides or normal settings, apply the path instead of the default one.

It allow classifying better. For example, it allows me to move automatically all my PDF into _assets/pdf/{filename}

Not sure what to call this, probably not a bug, related to multiple formats on pasteboard

Hi @trganda

I updated my Attachment Management to 0.8.3 and faced a surprising problem.

I use CleanShot X to edit images/screenshots before pasting into Obsidian. I noticed that the images I edited/copied from CleanShot were no longer being handled.

I found #63 issue and when I added the .* override, it started working again.

image

Is this the recommended solution? Just wanted to know if this was correct. Thank you!

Here is the difference, fyi, for these objects in the pasteboard, I used Pasteboard Viewer to display it.

original png image, copied and pasted (works fine). types are only public.png
screen 0

edit this image in CleanShot, add a line for example, and copy it
screen 1

after copying from CleanShot, this is the object, types are types are public.png and public.file-url
screen 2

pasting into Obsidian, it is no longer handled by the plugin
screen 4

New update just renamed all my files in my attachments folder

Was creating a new note in a folder

Within the folder I have an attachments folder

As I created the new note, all files were prefixed with the new note name?

This is a serious bug :/

Edit:

I know how this happens

My notes follow a strict naming methodology per folder

{fixed-prefix}-{variable-suffix}

If I create a note with the name {fixed-prefix}- and save, the plugin will go out and find all files starting with that and proceed to rename without considering which note is actually being edited

This will happen, on the odd occasion, when I'm still thinking what to name the {variable-suffix} portion and the note is saved

Can you please look into this?

Thanks

Disable notifications for pasting images?

Loving this plugin, it's just what I've wanted. But there are some small annoyances.

Every time I paste an image into a note from the clipboard, I get 2 notifications; One is for renaming the file (this happens regardless of whether I have ${originalname} set as the attachment format), and the other is 'Updated 1 link in file'.

I understand that this is native Obsidian simply reacting to what the plugin is doing, but is there some way to get around this and shut these notifications up?

My plugin settings are here if it matters:
Screenshot 2023-12-24 233504

Make file name of attachment available as key

Given the list of keys from the option page, there is no option to use the original filename of the attachment, i.e. what I want to have file.pdf renamed to 2023-05-16 file.pdf.

What be cool to have {{attachmentFileName}} available.

[FR]: Create the directory if it doesn't exist

The plugin seems cannot create the directory if doesn't exist
and the attachment location will fallback to obsidian's settings.

For example, if the plugin setting is as follows:

Root folder: assets
Attachment path: ${notename}
Attachment format ${date}

And the vault is like:

assets/
	note1/
		20230923.jpg
note1.md
note2.md

Pasting attachments to note1.md works as expected, if paste 20230924.jpg,
the image file will be located at assets/note1/20230924.jpg.

However, it doesn't work well on note2.md, if paste 20230924.jpg,
the directory assets/note2 won't be created,
and the attachment will fallback to obsidian's settings.

Attachment Numbering

Hello,

Was hoping to suggest a possible new variable to the naming scheme settings, as I'm not seeing the option for it currently.
It would be nice to have the option to add a file number when renaming a file, so for each image attached to the note will be numbered.

Example:
Attachment format: IMG-00${numbered}

  • User copy/pastes image such as a screenshot
  • File gets renamed to IMG-001.png
  • User copy/pastes another image
  • File gets renamed to IMG-002.png

If this is already implemented, apologies. I'm just not seeing it in the readme.

Feature Req: Ability to exclude paths

Love this plugin. It's a lifesaver for anyone that stores files/docs alongside their notes.

I have a small request

Could you please introduce the ability to exclude a list of paths?

While you work on this, it would be good to quickly introduce a shortcut to switch off and on

Attachment does not automatically renamed (bug)

Hello. Plugin doesn't change path of corresponding attachment

I choose these settings for attachments:
Obsidian settings:
Files and links -> Save new attachments in vault root by default
Plugin settings:
Save in the folder specified below
Root folder: _attachments
Attachment path: ${notepath}/${notename}
Attachment format: ${notename}-${originalname}
Automatically rename attachment: is set

(trying to use hidden folder .attachments) I tried to use hidden named folder .attachments but unfortunately it working in half way. Plugin creates all folders by the .attachment/${notepath} pattern but the attachment file always appear in vault folder and not renamed by attachment format

There is simple structure for example:
image

When I attach some image to the note the plugin creates corresponding path: _attachments/projects/1/note/note-0.png
But when I move (and/or rename) note.md from folder 1 to folder 2 I expect that attachment(s) will be automatically update its path, but it is still remain in the same location in _attachments

Should Automatically rename attachment setting work in this scenario?

${originalname} seems to be broken

I'm unable to use ${originalname} in conjunction with any other format parameters. In fact it seems to just not work at all.

Example:

Image file named "foo.jpg"
Attachment format of: ${originalname} - ${date}
Result: foo-1.jpg

Additionally, originalname doesn't appear to be supported in extension overrides, which is where I really need them the most. At least the dialog doesn't list it as an option, and it definitely doesn't work. I don't know if this is intended or an oversight.

FR: Folder Exceptions

It would be great to exclude certain folders or (even better) specify behavior on an folder by folder basis.

Local html files

It appears the local html files are not being moved per configured rules along with other file types. Can you please add the support to it as well? Thanks.

Bug: Renaming a note doesn't change PDF attachment links

Renaming a note successfully changes the images internal links and also the attachment folder name.
But PDF attachments doesn't automatically change it's internal links.
So the PDFs are still linked to the old ${notename} attachment folder.

Saving images by date

Hi
Is it possible to configure so that the added images are not just saved in the “images” folder, but in a subfolder but with the date the image was added “images\05-11-23”

I just need to save images by date, then I will clearly understand by folder which image I added when, and it will also get rid of garbage in the “images” folder

typo in variable/function name `origianlname` vs `originalname`

I'm confused about origianlname [sic]

references

Seems like this variable/function name was spelled incorrectly some time ago, and you may have attempted to correct it, but the misspelled version still exists, in the README:

If you want to use `${origianlname}` with other variables, like `${originalname}-${date}`. This plugin will persists the origianl name for future using. Suppose you change the **Attachment Format** from `${originalname}-${date}` to `IMG-${originalname}`, it's work fine.

as well as several places in the code, e.g. here:

import { saveOrigianlName } from "./lib/originalStorage";

and here

export function saveOrigianlName(

This should really be fixed to avoid confusion.

Renaming note creates folder structure with new folder instead of renaming the old one

Hi!
I have the latest versions of Obsidian (1.5.3) and Attachment Management (0.9.1).
Attachment path in plugin is set by default (i've also tried to changing it):

${notepath}/${notename}

I've made test note - Note1 with some random attachment and it work as expected:
image
Then I'm trying to rename Note1 => Note2 and expecting that attachment folder Note1 will become Note2 with that .png file. But instead I get an empty Note1 folder and Note2 folder with attachment:
image
Seems like misunderstood something or misconfig?
Thanks!

Delete old/empty folders

When a note is moved, the attachments are automatically renamed/moved to the new file path. This leaves the folders of the old filepath empty - and continually growing.

Would it be possible to recursively check if the attachment's folder (and parent folders) are empty and, if so, delete them?

Obsidian Files & Links Settings still active

First thank you for the plugin I think it is a great idea.

Now I installed it and these are my settings:

Files & Links Settings from Obsidian itself
image

Attachement Managament (the plugin)
image

Also I restarted Obsidian once, I didn't restart my computer thought.

I don't know maybe I set up something wrong,.
So the folder are generetated like that:
Attachements/${filename}/
But the copy pasted picture is not landing inside that folder, it's always going there where the Files & Links settings are set.
I tried to not copy the Obsidian settings too but there was the same problem.

Does somebody maybe know where I made the mistake?

Thanks have a nice day

Originally posted by @WannabeTechWarrior in #70

Re-Arrange会修改附件的文件名

在使用Re-Arrange attachment时,会自动修改附件的文件名。
期望:仅需要将附件放到对应目录即可,不能修复文件名称

Dropping multiple files at once causes some kind of timing issue

Hi @trganda

I am currently using your plugin v0.7.6 + Obsidian 1.4.2.

(But, this has been happening with older versions of both, I just have not reported it.)

Basically, when dragging and dropping a group of images onto a note, it seems there is some timing issue happening where the plugin does not update all references to the newly renamed images. So it breaks things. Maybe you need to wrap async/await somewhere? Just guessing

Here are my settings:

image

And, an example from just now of this case:

image

Here are the real files on the disk, the top window is where I dragged the files from (source) and the bottom window is the vault attachment folder that was created. As you can see, all images were processed/renamed, but the .md file did not get updated to reflect all the new filenames - only half of them did... so I have to manually correct this

image

Update usage description

With "Excluded paths" it needs at least one md file to work correctly. Please note that! I took me hours this friday to debug the feature!

[FR] Different settings for different folder

It will be cool if we could add the option to add "override folder".
For example, if an attachment is send in a specific folder, the processing will be different.

Use case :

  • I have some note that handle all illustration reference for my characters.
  • To facilitate search, I created an attachment folder (named Illustration) next to this folder.
  • With these options, I just send the image in my folder note “Illustration” (with the MD path Reference/Char 10/Illustration.md and the file will be sent to Reference/Char 10/Illustration/Image.png

For the moment, I need to rename/move the image each time, and it's pretty unconvenient.

I also need to keep my _assets folder for attachment I don't need to move

Automatic save and rename doesn't work for PDF files

I am using version 0.9.1
with this setting.
image
all files I drop in my notes will be renamed and stored in the archive folder except the *.pdf files. These files will not be renamed and moved to the archiv folder.

I am not quite sure what my mistake is or is it a bug?

Add command to "Rename attachments within current file"

  • Obsidian 1.3.5
  • attachment-management v0.5.5

It would be amazing to have be able to manually trigger the plugin to rename & reorganize the attachments within the currently active file.

By mistake, I triggered the "Rearrange linked attachments" action, and it re-organized my entire vault 😱

(awesome plugin by the way, thank you!)

[FR] : Exclude image filename or path

I wish I could set it to exclude files with a specific name or images in a specific path.
When using the Re-Arrange the attachment file function.

重命名 canvas 附件路径不会修改,控制台报错。

大佬你好,我发现重命名 canvas 附件路径不会修改,控制台报错。
具体流程:
新建白板 -> 粘贴图片 -> 点击左上角选择重命名 -> 重命名后,附件路径不会修改,控制台报错。
Obsidian 版本:1.5.3
插件版本:0.9.1

1

[BUG] No rename attachment correctly when the new attachment path was already exists.

On rename event, the callback will ignore to rename the attachment filename if the the attachment folder was already exists

    const exitsDst = await this.app.vault.adapter.exists(stripedNewAttachPath);
    if (exitsDst) {
      // if the file exists in the vault
      if (eventType === RENAME_EVENT_TYPE_FILE) {
        new Notice(`Same file name exists: ${stripedNewAttachPath}`);
        return;
      } else if (eventType === RENAME_EVENT_TYPE_FOLDER) {
        // for most case, this should not be happen, just notice it.
        new Notice(`Folder already exists: ${stripedNewAttachPath}`);
        return;
      }
    } else {
      const cfile = this.app.vault.getAbstractFileByPath(stripedOldAttachPath);
      if (cfile === null) {
        return;
      }
      await this.app.fileManager.renameFile(cfile, stripedNewAttachPath);
    }

Randomly change file names: This plug-in has a very strange behavior on mobile devices, please use it with caution.

This plug-in has a very strange bug on mobile devices, please use it with caution.

I use Synology Drive for file synchronization.

When you open Obsidian on a mobile device, you will find that a large number of image files have been renamed in batches, causing the links in the files to be broken.

It seems that the file being synchronized in the cloud is automatically renamed with the file currently opened on the mobile device. My guess is that the plug-in detects file changes and immediately renames them with the file name of the current note, regardless of whether these file changes are related to the current note. This is definitely a bug.

There are a lot of pictures in my notes, and it is very troublesome if the file names are incorrectly named.

Please be careful when using mobile devices.

Enhancement: Attachment Sequence

The Attachment Format was assigned as ${notename} in the plugin settings.

Eg. Note named "try-attachment"

Actual
The attachment seq. generated was try-attachment, try-attachment-1, try-attachment-2....

Expected
The attachment seq. to be try-attachment-1, try-attachment-2, try-attachment-3....

It would be neat if the sequence number (1) is assigned from the very first attachment.


Thanks for a fantastic utility plugin 👍

bug report

When used with the Custom Attachment Location plug-in, the default attachment path is automatically changed to the specified subfolder in the folder where the current folder resides, resulting in confusion.

When processing in large quantities, the attachment name that has been automatically changed by the program is not synchronized to the original md file, resulting in a broken chain, and the export to the local function of the clipping class plug-in cannot be used normally.

My attachment system is completely out of whack and a lot of attachments are missing.

Excalidraw中图片重命名第一次粘贴时会失效

大大你好,在Excalidraw中粘贴图片时,附件重命名有时间会在粘贴后,会失效,就是Excalidraw没来的及更改,Excalidraw有缓存原因,图片不会第一时间失效,导致下次进入Excalidraw图片直接是无效的图片,能否告知一些解决方案,或者插件适配一下Excalidraw画板吗

[BUG] attachment path empty

After setting the attachment path to empty, it is not possible to automatically modify the previously attached files uniformly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.