Add filesize in media item view controlller
Fixes #22737
To test:
Regression Notes
- Potential unintended areas of impact: n/a
- What I did to test those areas of impact (or what existing automated tests I relied on): n/a
- What automated tests I added (or what prevented me from doing so): n/a
PR submission checklist:
- [x] I have completed the Regression Notes.
- [x] I have considered adding unit tests for my changes.
- [x] I have considered adding accessibility improvements for my changes.
- [x] I have considered if this change warrants user-facing release notes and have added them to
RELEASE-NOTES.txtif necessary.
Testing checklist:
- [ ] WordPress.com sites and self-hosted Jetpack sites.
- [ ] Portrait and landscape orientations.
- [ ] Light and dark modes.
- [ ] Fonts: Larger, smaller and bold text.
- [ ] High contrast.
- [ ] VoiceOver.
- [ ] Languages with large words or with letters/accents not frequently used in English.
- [ ] Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
- [ ] iPhone and iPad.
- [ ] Multi-tasking: Split view and Slide over. (iPad)
Attachments
| Header | Header |
|---|---|
Hey, @hoangatuan. Thank you for addressing it, as it's been an outstanding item for a long time. However, it will require a bit more work. The issue is that the current Media.filesize is used only for local uploads, and so it's present only for files uploaded from the current device. In order to make it work for remote media assets, we'll need to extend the data model.
There is an open PR to add size to WordPresssKit https://github.com/wordpress-mobile/WordPressKit-iOS/pull/647. Unfortunately, the site it returns is a pre-formatted string so there is no way to store it in Media.filesize. This is were the work currently stopped.
I'm going to close it for now because the PR appears to be stale as, as pointed out in the following comment it will need to be updated when the API is updated. I think it might be worth tying it to the wordpress-rs, cc @jkmassel .