Skip to content

Added Media Manager tab - #5

Merged
hazmi-e205 merged 8 commits into
mainfrom
feat/media_manager
Oct 14, 2026
Merged

hazmi-e205 merged 8 commits into
mainfrom
feat/media_manager

Conversation

@hazmi-e205

Copy link
Copy Markdown
Owner

Adds a Media tab that shows the device's camera roll (/DCIM) as a thumbnail grid. It supports opening, pulling and deleting items, with a local thumbnail cache. It uses plain AFC, so there is no ffmpeg dependency.

What changed

  • Media tab UI (mainwindow.ui, mainwindow_mediamanager.cpp, mainwindow.h):
    • Icon grid with a "VIDEO" badge on videos.
    • Sort by Newest/Oldest and multi-select.
    • Double-click or Open fetches the original and opens it in the default app.
    • Pull saves the selection to a chosen folder.
    • Delete asks for confirmation.
    • Clear Cache removes cached thumbnails.
  • Device side (devicebridge_mediamanager.cpp, devicebridge.h):
    • EnumerateMediaFiles() walks /DCIM over AFC and returns path, size, mtime and video/image type.
    • FetchMediaFiles() downloads thumbnails or originals in one batch.
    • Thumbnails come from /PhotoData/Thumbnails/V2/. The thumbnail filename differs by iOS version (5003.JPG on iOS 15, 5005.JPG on others), so the directory is listed and the first .jpg is used, instead of hardcoding a name.
  • Cache: Thumbnails are stored under LocalData/Thumbnail/, keyed by sha1(udid|path), and added as a THUMBNAIL entry in DIRECTORY_TYPE (utils.h/.cpp). Full-size files opened from the tab go to LocalData/Temp/.
  • Toolbar styling: The Media buttons match the File Manager toolbar: icon-only flat Refresh, Pull, Open, Delete, and Clear Cache with the trash icon, using the FLAT_BUTTON stylesheet.
  • Device disconnect: mainwindow_devices.cpp clears the media model and pending opens on disconnect.

Notes for reviewers

  • The first commits come from an earlier ffmpeg-based preview attempt, which is added and then reverted in the same series. That part nets to zero, and no ffmpeg files or premake5.lua changes remain. I'd suggest squash merge to keep history readable.
  • Open uses Push's icon but keeps the text "Open", because it opens the file locally and doesn't push anything.
  • Thumbnail discovery adds one extra AFC directory listing per media item during the scan. Very large libraries (many thousands of items) will scan noticeably slower.

Testing

  • Tested on a real iPhone 7, iOS 15: Media tab scan, thumbnail display (verified after the 5003.JPG fix) and Open of full-size items.
  • Tested on a real iPhone 12, iOS 26: Initial implementation

@hazmi-e205
hazmi-e205 merged commit 448b094 into main Oct 14, 2026
0 of 2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants