Feat: Storage Overview tab in Settings — see library size and clear app cache
Summary
Add a Storage tab to the Settings page (third tab: General | Account | Storage) that answers one question for the user: "where is my disk space going?" — and lets them reclaim space safely.
It splits into two clearly separated sections, so the user is never misled about what is deletable:
| Section | What it shows | Action |
|---|---|---|
| Library Media Size | The user's own photos and videos across indexed folders, split photos vs videos (size + file count) | Read-only — PictoPy never deletes originals |
| PictoPy App Cache | Helper files PictoPy created — thumbnails and saved video frames | Clearable — a "Clear App Cache" button; safe because these regenerate on view |
Guiding principle: honesty through separation. The user's real media (which PictoPy only reads) is shown but never deletable here; only PictoPy's own regenerable cache can be cleared.
Motivation
- There is currently no single place that shows total disk usage.
- The thumbnail cache cannot be seen or cleared at all today.
- A "Clear cache" button exists but only clears video frames, and it's buried in Settings → Video Tagging → Frame Cache. This feature consolidates that into one discoverable place and extends it to thumbnails.
So this is consolidation + extension, not duplication:
| Today | With Storage tab | |
|---|---|---|
| See total disk usage | Nowhere | One place |
| Library size (photos vs videos) | Nowhere | Shown, read-only |
| Clear video frames | Buried in Video Tagging | Shown here too, reusing the same purge logic |
| Clear thumbnails | Not possible | Added (new) |
Proposed implementation
Backend — a new GET /storage/stats aggregates: indexed photo/video sizes (summing os.path.getsize over DB paths, read-only), thumbnail cache (THUMBNAIL_IMAGES_PATH), video-frame cache (reusing video_util_purge_frame_cache's size logic), DATABASE_PATH, and MODEL_EXPORTS_PATH. A clear action reuses the existing frame-cache purge plus an equivalent thumbnail purge — AI tags, face clusters, and DB records stay untouched.
Frontend — a third Settings tab with two cards matching existing design tokens; sizes come from /storage/stats, and the Clear button triggers the purge then refreshes.
Most of the plumbing already exists (video_util_purge_frame_cache(), the settings paths, and images.path / videos.path in the DB) — the feature mainly aggregates and exposes it.
A detailed report with real measured numbers, the JSON schema, and architecture/flow diagrams is available and can be attached to the PR.
PictoPy_Storage_Feature_Report.docx
Add ScreenShots
Proposed UI (mockup)
The Storage tab, two-card layout:
- Library Media Size — total size, a photos/videos split bar, size + file-count per type, and a "PictoPy only reads these files; originals are never altered or deleted" line.
- PictoPy App Cache — a row per cache type (thumbnails, video frames) with a "Regenerates on view" tag and size, a total, and a Clear App Cache button noting "AI tags, face clusters, and database records remain untouched."
Option1:
Option2:
Record
- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
@rohan-pandeyy can you assign this issue to me and suggest which option would be better ?
⚠️ Potential Duplicate Issue (Semantic Match)
This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:
-
Follow up video-library folder counts, gallery reuse, and thumbnail cleanup (#1404, open) https://github.com/AOSSIE-Org/PictoPy/issues/1404 Similarity: 61.5%
-
Feat: In-App Video Deletion with Disk/Database Options and Library Exclusion (#1623, open) https://github.com/AOSSIE-Org/PictoPy/issues/1623 Similarity: 59.3%
-
BUG: Orphan thumbnail files permanently leak disk space when folders are deleted (#1159, open) https://github.com/AOSSIE-Org/PictoPy/issues/1159 Similarity: 57.2%
Please review before proceeding.
Hi! I'd like to work on this issue.
My proposed approach is to implement the Storage overview in two parts:
-
Backend: Add a storage statistics endpoint to calculate indexed photo/video sizes and cache usage, reusing the existing frame-cache logic. Implement safe thumbnail and video-frame cache cleanup without touching original media, database records, or AI-generated metadata.
-
Frontend: Add a Storage tab under Settings with separate Library Media Size and PictoPy App Cache sections, following the existing design system. Include loading/error states and refresh the statistics after cache cleanup.
I'll also add appropriate backend and frontend tests, particularly to verify that original media and database records remain untouched.
I'd prefer the stacked-card layout for better readability, with a responsive two-column layout on wider screens.
I'm happy to follow the existing project conventions and adjust the implementation based on maintainer feedback.
Hi! I'd like to work on this issue.
My proposed approach is to implement the Storage overview in two parts:
- Backend: Add a storage statistics endpoint to calculate indexed photo/video sizes and cache usage, reusing the existing frame-cache logic. Implement safe thumbnail and video-frame cache cleanup without touching original media, database records, or AI-generated metadata.
- Frontend: Add a Storage tab under Settings with separate Library Media Size and PictoPy App Cache sections, following the existing design system. Include loading/error states and refresh the statistics after cache cleanup.
I'll also add appropriate backend and frontend tests, particularly to verify that original media and database records remain untouched.
I'd prefer the stacked-card layout for better readability, with a responsive two-column layout on wider screens.
I'm happy to follow the existing project conventions and adjust the implementation based on maintainer feedback.
Sorry @avika269 this is a feature proposed by me ,so I will look forward to work on it.Please look for other suitable issues.Thanks for understanding
The Storage page will be nested inside General, not Account.
Option 2 looks better
Thanks for explaining the issue. I'd like to work on this. I'll first review the existing folder-related functions and tests, then implement the folder existence validation in sync_folder() and add regression tests to ensure that invalid folder IDs return a 404 without modifying the database.
I'll keep the changes focused on this issue and follow the project's existing conventions.
Option 2 looks better
ok will work on it ,this looks fine right?