akosbalasko / yarle

Yarle - The ultimate converter of Evernote notes to Markdown
https://github.com/akosbalasko/yarle
MIT License
1.42k stars 81 forks source link

unknown_filename attachments in each enex folder make it impossible to merge the collection #329

Closed chtx closed 2 years ago

chtx commented 2 years ago

When I export my entire Evernote collection, it gets split into 7 enex files. Then Yarle puts each enex file output in separate folder, each folder with its own unknown_filename1,2,3,4,5... making it impossible to merge the collection.

Possible solution: always give unique names to unknown files.

lesca commented 2 years ago

Definitely agree!

Suggest to customize the attachment name, e.g., <prefix>_.jpg where prefix is customizable or use the enex file name as default prefix.

akosbalasko commented 2 years ago

Hi All, @lesca okay, so it looks like an option that enables to store the attachments globally if multiple enex files are selected, am I right?

lesca commented 2 years ago

@akosbalasko

Current attachment naming: image

For example, multiple converting can cause multiple _resource folder. As the pictures in _resources are named beginning from 1, it's impossible to merge the _resources folders together.

Hopefully to be:

<prefix>_1.jpg
<prefix>_2.jpg
<prefix>_3.jpg

where <prefix> can be customized.

chtx commented 2 years ago

Or simpler to implement: generate a random name instead of "unknown_filename". Example: 00d79b519517efb243f91ecfc6aaeb88.jpg. It'll solve the problem 100%.

lesca commented 2 years ago

Or simpler to implement: generate a random name instead of "unknown_filename". Example: 00d79b519517efb243f91ecfc6aaeb88.jpg. It'll solve the problem 100%.

sounds good, as long as we can merge the folders. 💯

chtx commented 2 years ago

@akosbalasko Please increase the priority of this feature. Thank you.

akosbalasko commented 2 years ago

@chtx Hi all, I have a feeling that this feature has already been implemented, I introduced a new property called 'haveGlobalResources' ( in the GUI it is a checkbox with the label 'Store attachments in one folder only '). I tested it as a unit test now and it looks like that it works properly. So even if the filenames are named like 'unknown_filename', Yarle will put an incremental postfix after this like as follows: unknown_filename.1, unknown_filename.2 etc. Could you please try this setting?

lesca commented 2 years ago

Hi @akosbalasko , I know this feature, but this won't work if I want to merge two folders, because the attachments will be replaced due to the same name. So use Hash name would be a perfect solution.

@chtx There is a workaround, use Obisidian plugin Unique Attachments. It can rename all attachments to hash name, and remove duplicated attachments. It's perfect to me.

akosbalasko commented 2 years ago

@lesca ohhh, okay, so we talk about several conversions, not just one, but multiple conversions over time. Okok, now I see the issue, thanks a lot! :) But what if we convert notes first time, it generates a _resources folder, then we create a folder with the subsequent notebook's name, and a _resources folder within, and then move the content from the previous conversion to this folder? I think that would solve the issue as a workaround. But anyway, thank you again, now I the point, this is going to be the next feature to be implemented.

akosbalasko commented 2 years ago

@lesca @chtx This feature is released in the latest version (4.11.0), please check it out. I close this issue, but don't hesitate to contact if something doesn't work as expected. Thank you!