-
Notifications
You must be signed in to change notification settings - Fork 327
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
feat(dialog): set len
and modified_at
fields in FileResponse
on desktop
#1295
feat(dialog): set len
and modified_at
fields in FileResponse
on desktop
#1295
Conversation
@FabianLars why are we returning metadata in the dialog plugin? shouldn't that be left to be handled by the fs plugin? |
@amrbashir we want to get the file size right from the input rather than then using another plugin to read it. Our business case is to prevent files from being processed if they are larger than 100mb |
no idea, wasn't involved in that at all. i assume it makes sense to do so on mobile (not so much on desktop then which is why it's all None etc) |
It is not the responsibility of the dialog plugin to access the metadata of the file, it should be done by the |
maybe @lucasfernog has better idea, it should be removed imo |
Are you saying then that we should invoke dialog and fs just to get the size of the file? I understand the separation of concerns between the 2 modules, but in my opinion metadata access from the dialog is usefull to have on the fly. |
yes, this is what I meant.
It will still call the same APIs under the hood, and even though it is an extra call from JS side, which can be considered more overhead and a bit slower, it is still very very miniscule. That said, I am gonna close the PR and open another to remove the metadata from the dialog plugin, I recommend you either use |
Looks like |
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 contribution
len
and modified_at
fields in FileResponse
on desktop
Description:
This pull request introduces a feature enhancement to the FileResponse struct in the Tauri project. The enhancement allows the FileResponse struct to automatically compute and include the size of the file in bytes when creating a new instance.
Changes:
Benefits:
Considerations: