Giter Club home page Giter Club logo

obsidian-attachment-name-formatting's People

Contributors

jaccouille avatar jyc333 avatar sanjarcode 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

Watchers

 avatar  avatar

obsidian-attachment-name-formatting's Issues

#22 not fixed

Has the bug #22 really been fixed?I still meet this error in version 1.9.5. and I go back to 1.9.3, there won't be any problems. I think it was an error caused by the added functionality of #20

Feature: Rename all notes within a folder or vault.

I suggest three related features here.

  1. Add a feature to allow user to rename the attachments for all the notes within a folder and all subfolders.

  2. Another feature to rename the attachments within vault.

  3. Log

Also important to save a log that contain any attachments that cannot rename successfully such as the known bugs. When it is finish renaming all the notes, it will automatically show the log how many attachments can't be rename unsuccessful and the link to the note and attachment.

The log layout might look something this.

Note Title 1 (Bold)

  • Attachment name 1
  • Attachment name 2

Note Title 2 (Bold)

  • Attachment name 1
  • Attachment name 2

Feature: Option to add "renamed time" in formatting name like : "filename_attachmentFormat_indexNumber_renamed time.xxx"

Because renamed the attachment won't update file modify time, when I inserted attachment and formated name second time and synchronize file,the issue will occur on synchronized terminal.And then the synchronized terminal will distroy online data.Like this:

synchronized terminal will distroy online data:

Old_Attachment_Name Old_Modify_Time Old_Attachment_ID problem New_Attachment_Name New_Modify_Time New_Attachment_ID
attachment1 1:00 1 attachment1 1:00 1
attachment2 2:00 2 attachment2 7:00 7(inserted)
attachment3 3:00 3 wrong to replace→ attachment3 2:00 2
attachment4 4:00 4 wrong to replace→ attachment4 3:00 3
attachment5 5:00 5 wrong to replace→ attachment5 4:00 4
attachment6 6:00 6 wrong to replace→ attachment6 5:00 5
attachment7 6:00 6

online data is wrong:

Attachment_Name Modify_Time Attachment_ID problem
attachment1 1:00 1 none
attachment2 7:00 7(inserted) none
attachment3 3:00 3 ID must be 2
attachment4 4:00 4 ID must be 3
attachment5 5:00 5 ID must be 4
attachment6 6:00 6 ID must be 5
attachment7 6:00 6 ID must be 6

So I suggest adding a parameter to distinguish between files with the same name——add "renamed time" in formatting name like : "filename_attachmentFormat_indexNumber_renamed time.xxx"。Example:

Old_Attachment_Name Old_Modify_Time Old_Attachment_ID New_Attachment_Name New_Modify_Time New_Attachment_ID
attachment1_20230422230012 1:00 1 attachment1_20230422230512 1:00 1
attachment2_20230422230013 2:00 2 attachment2_20230422230513 7:00 7(inserted)
attachment3_20230422230014 3:00 3 won't replace→ attachment3_20230422230514 2:00 2
attachment4_20230422230015 4:00 4 won't replace→ attachment4_20230422230515 3:00 3
attachment5_20230422230016 5:00 5 won't replace→ attachment5_20230422230516 4:00 4
attachment6_20230422230017 6:00 6 won't replace→ attachment6_20230422230517 5:00 5
attachment7_20230423230518 6:00 6

This feature also can improve experience of "Automatic formatting" feature.

Activate plugin manually

Can you add a setting to allow the plugin to be triggered manually, instead of automatically?

If you use an image in more than one note, it renames the image each time you open up each note even though the image does not and probably should not be renamed.

Error: Destination file already exists!

Hi!

Thanks for making this plugin and maintaining it. I find it very useful!
I found a possible bug.

How to reproduce:

  1. Make a note
  2. Add an image (image will be renamed to eg. note_image_1.jpg)
  3. Add a new image before the first image

This triggers an error for me: Error: Destination file already exists!

My current workaround:

  1. Toggle on Add modify time after index
  2. Run Rescan attachments in current file
  3. Toggle off Add modify time after index
  4. Run Rescan attachments in current file again

[feature request] Add rescan option

Hi! Love this plugin :) Thanks for working on this. I have an issue where sometimes when I insert an attachment the plugin does not pick up on it. I'm not seeing any issues in the console. Would it be possible to make a command that checks all the attachments in the note and renames them if still needed?

Feature: Option to Disable renaming of pdf

When Adding pdf files to a document I would like to option to retain the name of the pdf rather than renaming them. This would allow for easier management of notes with multiple pdf files embedded.

Could this be set either in option or through YAML?

feature request

spaces in file name is not a good choice, please change the file name to
filename_attachmentFormat_indexNumber.xxx
thank you

Allow / in names

As a user, I would like to organize my attachments by file type, so that I can easily find them later by file type.

I installed this plugin, hoping that I would be able to name my images "images/2348980.png", video files "videos/2342345.wav", etc. like I have done with periodic notes. This way there would be subfolders in the Attachments folder.

Rescan Attachments in Current File always put renamed attachments at "assets" folder of root of vault

I have Obsidian settings under "Files & Links" -> Default location for new attachments -> In subfolder under current folder.

When editing a file, invoke plugin command "Attachment Name Formatting: Rescan Attachments in Current File" from Obsidian Command Palette menu. The renamed attachments are relocated to "assets" folder under Vault root, instead of "assets" folder under the current folder.

Expected behaviour: the renamed attachments should move to location following the Obsidian settings under "Files & Links" -> Default location for new attachments".

Add package-lock.json or yarn.lock to version control for reproducible builds

Hello, i'm looking for ways that help make plugins more secure. One way is through Reproducible Builds, which could detect a plugin version with a malicious main.js file that wasn't actually built from the source code.

A package-lock.json or yarn.lock is needed though to build a main.js from source that's identical to the one obsidian downloads when installing the plugin. In general, any way you could make the build process easy to reproduce would help, like by removing steps that only work on your local development environment.

mobile support

Could this plugin add support to mobile devices?
It seems that it doesn't work on mobile devices now.

Feature Request: Docs, e-mail and other categories

Hi

This looks like a useful plugin, but presently it's only useful for the odd image

I would, really, appreciate it if the following categories could be introduced:

Documents - with the following file extensions (and any others you can think of)

.doc, .docm, .docx , .docx , .dot, .dotm, .dotx, .odt, .rtf, .txt, .wps, .xps, xls, xlsx, xlsm, xltm, xlsb, xltx, ods, .numbers, .xl, .pages, .tex, .mpp, csv, ppt, pptx, pdf, dwg, dxf, xlthtml, .xlsmhtml, .xlshtml, .pptmhtml, .ppthtml, .dothtml, .docmhtml, .dochtml

E-mail - with the following file extensions (and any others you can think of)

.eml, .msg

Logs and Traces - with the following file extensions (and any others you can think of)

.log, .cap, .pcap

Diagrams - with the following file extensions (and any others you can think of)

.vsdx, .vsd, .adp, .sdr, .cvx, .graffle, .notebook, .vdx, .cddz, .vss, .igs, .rtd, .opx, .vst, .ink, .mmap, .flo, .nmind, .brd, .dm2, .vsx, .vtx, .itm, .flo, .rise, .mgcb, .xmmap, .mp, .dia, .xmi, .vpp, .wdp, .igx, .edg, .ygf, .xmind, .gdraw, .czd, .vstx, .vssx, .vstm, .vssm, .pn, .sx, .edx, .edxz, .bpm, .bpmc, .pu, .plantuml, .simp, .cdml, .spl7, .de, .eddx, .nvp, .adf, .gxt, .anb, .cvxcad, .monopic, .monosnippet, .nsa, .bpmn, .mag, .jpd, .sda, .xlgc, .xbk, .ddt, .nbk, .spk, .mmat, .cdt, .tpl, .umlclass, .abc, .af3, .gtemplate, .mgtx, .cdsx, .scl, .far, .flw, .gliffy, .architect, .mmas, .drawio, .ccd, .cir, .ndb, .ndx, .ndtx, .nlx, .nlb, .esd, .fhc, .mmx, .art, .vpd, .mdeck, .xmdeck, .arh, .af2, .imd, .gpj, .mmms, .xmmas

Archive - with the following file extensions (and any others you can think of)

.7z, .cbr, .deb, .gz, .pak, .pkg, .rar, .rpm, .tar.gz, .xapk, .zip, .zipx

Web - with the following file extensions (and any others you can think of)

.htmlz, .zhtml, .xht, .dhtml, .htx, .hhk, .chm, .oth, .mhtml, .hhc, .mht

Code - with the following file extensions (and any others you can think of)

.appxbundle, .lgo, .in, .unity, .awk, .kv, .rbxl, .cs, .sb, .sb2, .ypr, .kt, .ipr, .appx, .ino, .sb3, .rbxm, .class, .pyd, .py, .cpp, .luc, .c, .gitattributes, .hs, .gs, .arsc, .vbp, .slogo, .ph, .mm, .tt, .am4, .xq, .has, .gch, .vcproj, .sc, .aidl, .lua, .md, .b, .xap, .pas, .asm, .cc, .pbg, .resx, .trx, .po, .resources, .java, .patch, .gm81, .swc, .config, .vdproj, .mf, .dex, .csproj, .res, .ocx, .res, .ise, .gmx, .gmk, .swift, .ymp, .smali, .hpp, .fs, .pwn, .qpr, .v12.suo, .def, .cod, .r, .sln, .yml, .appxupload, .cd, .y, .bbc, .fbp, .bet, .capx, .rb, .nk, .bluej, .pjx, .suo, .rul, .swd, .so, .aia, .xsd, .dtd, .mpx, .bpl, .ane, .xcdatamodeld, .nuspec, .entitlements, .lisp, .wdgt, .pbxbtree, .ssi, .xamlx, .ccs, .ctp, .dgml, .pyw, .agi, .s, .ml, .au3, .mk, .xt, .dox, .proto, .targets, .pb, .ipr, .pl, .s19, .ex, .vcxproj, .d, .vb, .o, .pbj, .hbs, .rpy, .fxml, .v, .h, .tk, .w32, .idb, .myapp, .as3proj, .rexx, .w, .l, .scc, .ap_, .fpm, .twig, .apa, .asc, .4db, .cxp, .yaml, .xaml, .ads, .sc, .msix, .asi, .gsproj, .jspf, .gm6, .ftl, .pbxuser, .csx, .ipch, .ui, .testsettings, .jsfl, .bas, .tlh, .rdlc, .tpu, .csp, .fxc, .dcp, .f, .abc, .mo, .pas, .nupkg, .mrt, .cbp, .livecode, .i, .as, .am7, .f90, .cp, .cls, .mak, .sud, .framework, .vbx, .hh, .pbxproj, .storyboard, .kdevprj, .xcworkspace, .idl, .dmd, .kdevelop, .plc, .gld, .iml, .vm, .svn-base, .cu, .v, .diff, .inc, .markdown, .vhd, .gitignore, .m, .wiq, .as2proj, .pika, .jic, .autoplay, .hal, .vbg, .sma, .alb, .rsrc, .ism, .dpr, .nib, .asm, .bdsproj, .prg, .pbk, .tur, .fsscript, .am6, .iconset, .pro, .ist, .wdp, .wdw, .wdl, .for, .ltb, .bsc, .mcp, .nvv, .lsproj, .sltng, .haml, .oca, .lds, .lnt, .df1, .wsc, .xpp, .dproj, .erl, .dsgm, .clw, .rbc, .m, .bb, .sas, .wsp, .nsi, .ilk, .dpl, .dbml, .cxx, .pri, .nbc, .octest, .omo, .xcconfig, .pl1, .pkgdef, .m4, .gem, .nls, .sup, .kpl, .playground, .vbproj, .uml, .pl, .mss, .owl, .xoml, .xojo_xml_project, .ctxt, .inl, .mshc, .msha, .sym, .v11.suo, .erb, .cdf, .hxx, .pcp, .mer, .pyx, .jpr, .cp, .pxd, .csi, .src, .a2w, .exp, .forth, .ccn, .dgsl, .pli, .rss, .vdp, .nw, .pm, .vsmacros, .edmx, .dm1, .wxl, .xojo_project, .t, .mv, .nsh, .asvf, .resw, .wxs, .ppc, .lbi, .dob, .ftn, .ptl, .mom, .cbl, .dec, .hpf, .vssscc, .psc, .acd, .caf, .ss, .a, .pot, .gszip, .wixout, .rnc, .iwb, .p3d, .gemspec, .rbp, .bs2, .wixobj, .wpw, .lbs, .wixlib, .dpkw, .wixmst, .src.rpm, .xcodeproj, .vspx, .jcp, .rav, .vbz, .fxl, .xcsnapshots, .xojo_binary_project, .wdgtproj, .scriptterminology, .pdm, .odl, .tcl, .pkgundef, .xojo_menu, .tld, .gorm, .eql, .xql, .rodl, .xcappdata, .mdzip, .tmlanguage, .textfactory, .bbproject, .cvsrc, .vdm, .lxsproj, .clips, .xqm, .ned, .fbz7, .vsps, .addin, .refresh, .rise, .ged, .fxcproj, .testrunconfig, .resjson, .mshi, .bcp, .am5, .lucidsnippet, .gs3, .ccp, .cob, .iws, .tli, .vspscc, .ple, .dbproj, .pri, .vsz, .vtm, .gmo, .fsproj, .gameproj, .licx, .rex, .dcuil, .tns, .vc, .pch, .ent, .spec, .c, .brx, .xcarchive, .lproj, .idt, .dba, .licenses, .greenfoot, .ctl, .4th, .fsproj, .dsp, .xib, .edml, .vgc, .p, .tds, .mod, .bbprojectd, .csn, .vtv, .aps, .r, .dpk, .msp, .mpr, .fxpl, .bpg, .groupproj, .inform, .vsmdi, .sdef, .vsmproj, .rbw, .sqlproj, .prg, .fsx, .vtml, .gfar, .dbo, .tu, .dcproj, .psm1, .pde, .lhs, .cfc, .wixproj, .pod, .vsp, .dcu, .rkt, .exw, .dfm, .csi, .msl, .ncb, .vcp, .dba, .fsi, .xquery, .sbproj, .nqc, .magik, .groovy, .wixmsp, .lit, .wixpdb, .scriptsuite, .ssc, .wxi, .dbpro, .artproj, .ccgame, .jpx, .deviceids, .gmd, .r

Other

Extensions you do not cater for go into an Other "bucket"

Thanks

PS: The first 2 categories are most important (Documents and e-mail)

Feature Request: Move all attachments of a file type to a subfolder named after the .md file

I have a LOT of image attachments in my vault, and the attachments/img/ folder that this plugin sends them all to has 919 files as of this writing. Having that many makes trying to find a particular file in either Obsidian's or the OS's file explorer rather unwieldy.

I propose that a feature be added (can be optional if you wish) that makes the plugin automatically create a subfolder within the subfolder created by the "Subfolders for attachments" setting, named after the note that the attachment belongs to, and save all attachments into that sub-subfolder.

For example, if I'm working in a note (foo.md) and paste several images into the note, the plugin would rename the files as normal (e.g. foo_image_1.png), create a folder called foo within attachments/img/, and move all the attachments for foo.md (of the file type that belongs to that subfolder, in this case images) into attachments/img/foo/.

In the case of my vault, rather than scrolling through 919 images to find the right one, I would instead only need to scroll through 112 folders to find the attachments for the note that I'm looking for. Much more manageable!

Thank you for making such a great plugin! :)

Attachment Name Formatting: Rescan Attachments in Current File

The attachment renaming feature seems to only work for wiki links, using eg [[filename]] and such Wiki links.
Standard Markdown hyperlink syntax is used by default, such as ()[] is invalid

In addition, the ability to export attachments that are not linked in the library is also limited
If there is a vault in the vault, all attachments in the inner vault will be exported

Unable to rename automatically

Hi, when I first installed this plugin in July, all open notes were automatically renamed with the filename of the attachment. After a recent update to 1.4.4, it was found that the function of automatically updating filenames is no longer available. What's the situation now?

Images/files disappearing or displaying incorrectly after file renames

When I paste in new images, the rename process will sometimes lose images(i.e., the image gets tmp renamed and then fully renamed, but the link in the note still points to the tmp file). Other times, Obsidian live preview will display the wrong image and the read view will display the correct image. I can even link to the same image next to each other and it will display two different images.

[feature request] Add "move all files in current note" option & export all unused files

[feature request]

Add "move all files from current note" option

This would allow to easily gather all note related files/attachments and move them to another vault or quickly share them.

Optionally allow for autodeletion after export/move.

export all unused files

Allow export of all attachments which are not used in any notes.
This would help tremendously with cleanup.

Thank you for this great plugin.

"Scan files in folder" command isn't recursive?

Hi!

First of all: thanks for your work, I appreciate the effort you put into this plugin: managing attachments is both important and a mess, and honestly this plugin seems to be my favourite one to manage attachments.

After installing it, everything works as intended. However, as you can imagine, I've already made hundred of attachments and I want to "normalize" them

immagine

There's the option "Scan files in folder" but it acts weird:

  • sometimes it doesn't actual get attachment within a file, so it doesn't move anything
  • seems not to be recursive: if I select a parent folder (e.g. "Courses") where there are several notes or subfolders containing notes with attachments (e.g. "Courses/My Courses" with "Day 1 lecture notes.md", "Day 2 - other notes.md" etc) it doesn't move anything, albeit these notes are full of .png images
    • Isn't that option recursive?

[BUG]Changing all attachment names may lose

I found that when I insert an image in the header, all the file names below are changed once.
But it may cause the files to be lost.
I observed that the file name was changed to tmp... first. My guess is that closing the file or sync upload at this point may leave the tmp... name there, thus causing the note can't be found in the temp file name.

Is it possible to pass another naming strategy, such as using time as the name and increasing the suffix when the name is duplicated?

FR:阅读模式下右键菜单加一个在新标签页打开的功能

因为阅读模式下没有重命名功能,如果能在新标签页打开图片,然后进行重命名以及其他操作(比如我会看图片的反链面板,看看有什么笔记都引用了这个图片)会方便一些,在ob内部进行操作,也能更新链接

2.1.7 cannot work

Rescan Attachments in Current File,It is not working properly,nothing happened,The attachment has not been renamed

When I go back to 2.1.5, everything is running smoothly

Add optional unqiue string in attachment name

Situation

My notes follow a rule:

  1. Have a page (.md) for notes
  2. Avoid having a page with the same name as a folder, especially on the same level, instead create an index.md in the folder.

I have these rules since they make it navigate in a file explorer (reduces list size by half). And also for publishing the notes as a website.

Problem

The current plugin format does not consider the route of the file (i.e. folder1/folder2/folder3).
It only considers the fileName (attachmentType remains the same, and indexNumber may also be duplicated easily, so let's ignore them).

Due to my rule 2, all attachments in index.md files will be named the same - index-image-indexNumber.xxx.

Solution

I know that the problem is specific to my situation, and I think it's fine if the whole route is not in the attachment name (which would also solve the problem - but would make file names too big).

A simpler solution would be to have a unique identifier (by some logic - maybe hash the route) at the end of the filename.
Storing "time" as the unique string doesn't help, since I also do linting (which edits multiple files quickly - at almost the same time).

keep the original file name / add to new filename

  • change the name to the note name is very good so you can easy find all the attachments to a note
  • BUT add the option to keep the original attachment name, so it is included in the new name
  • then you can also easy find back the attachment in other places outside the vault

Bug: The connector can't be set "None"

When I set connectors in a note like the image below,
Snipaste_2024-01-07_20-16-46
I get a 'Note_image_1.png' as return, which is not what I really want.
I hope the correct name is 'Note_image1.png'.

This problem is sloved in the past version, but it happened again when I updated in 2.1.8. I hope this can be solved, thank you!

Feature Request: Seperate the two connectors

Between the file name and attachment name, we can set a connector, while there is no need to force the same connector between attachment name and the number. So I suggest we can seperate these two connectors and set them by ourselves.

image

As the image shows, the connector in the picture force the same connector between attachment name and number. I suggest we can set two options : one is connector between the file name and attachment name, another is connector between attachment name and the number.

By the way , I hope the connector can be set none, which means I don't need any connector there. Thank you!

Old pasted images are now missing - not created yet

I use very often notes with pasted screenshots.

Today I was reviewing older daily notes and I realized that in older notes (created before I started to use your plugin), some pictures are now missing. There is only info - pasted image was not created yet - click to create it.

image

Why I think it is connected with your plugin, is that it started about 2 weeks ago and there was no other change in my Obsidian. And - what is strange - the 1st image in this note was renamed and has new name. The 2nd is gone and has old name.

There is no other plugin working with files in attachment folder, only yours.

It looks like when I open the note, plugin starts to rename images - few are successfuly renamed - and others are maybe deleted, maybe renamed... I can not find these missing pictures in attachment folder with even with new/old names. They are gone.

Feature request: Ignore certain file types

Love the extension so far, I wish there was a way however to exclude certain file types from being renamed. I am mainly thinking about svg for example. I create a lot of diagrams using draw.io, which I consider less as part of a note, and more like stand-alone data (which I often refer to in multiple notes). Would it be possible to add file type exclusion for this plugin?
Thank you for your work either way!

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.