-
Notifications
You must be signed in to change notification settings - Fork 143
feat: improve attachment storage for API #1633
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
base: main
Are you sure you want to change the base?
Conversation
bdc2b65 to
3c4d132
Compare
- Attachments are stored in note-specific folder - Attachment filenames are retained This mirrors the behaviour for attachments created in the web UI.
3c4d132 to
a4d6891
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this and for raising question at #1623. I need time to read through the previous discussions when the current API was implemented before I can properly review this
|
Thanks @enjeck! 🙏 Once this is resolved I'll get a release of Iotas out using the API :) |
|
Oh hrmm yeah reading back through the discussion I picked up that this impacts moving notes between categories too; without this fix the attachments are left in the previous location, disconnected from the note. |
Yes, also previously reported at #1470 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I mentioned at #1623 (comment), I like the idea of using the original file name instead of a random text. But concerned about the new link structure. Apart from the concerns with using the file ID, I wonder how backwards compatible it is. I wonder if it's easier to just keep the existing struture in the meantime and instead explore moving things around when the category is changed.
Responded over at #1623 |
This mirrors the behaviour for attachments created in the web UI, bringing the following benefits:
Most of the code is based on what's used in Text.
If the API wasn't already public I would switch the name of the return element for image creation to
path(fromfilename). As there likely isn't any project consuming the API yet this may not be a bad idea.Addresses part of #1623.