Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Longer File Names and Provide Warnings for Automatic Shortening #293

Open
AltoRetrato opened this issue Aug 27, 2024 · 1 comment

Comments

@AltoRetrato
Copy link

I noticed that some long file names are shortened after being imported, but often there is important information in file names that users do not want removed. I understand that there are file name length limitations on many systems, but it seems the longest total path for a file after importing was only 160 characters - yet I can easily create much longer file names. Ideally, the Importer plugin would ask me to rename any file if necessary, or at least inform me when it is automatically shortening file names.

@AltoRetrato
Copy link
Author

I found the issue in getResourceFileProperties() (/src/formats/yarle/utils/filename-utils.ts): importer limits resource names to just 50 characters.

const fileNamePrefix = resource['resource-attributes']['file-name'].substr(0, 50);

As a workaround, I removed the .substr(0, 50) from the plugin code (.obsidian\plugins\obsidian-importer\main.js). This not only let me keep the attachments with their original names, but also solved issues where files were not correctly linked after importing notes from Evernote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant