-
-
Notifications
You must be signed in to change notification settings - Fork 602
Description
Summary
Currently, when a folder is added to PictoPy, the images are indexed only once. Any changes made outside the application—such as adding new photos, deleting files, or renaming images using the system file explorer—are not reflected automatically inside PictoPy.
This feature proposes adding real-time folder watching, so PictoPy always stays in sync with the actual file system without requiring users to manually rescan folders.
Problem Description
In real-world usage, users often manage their photo collections externally using file managers, cameras, or other tools.
With the current behavior:
- Newly added images don’t appear unless the folder is reloaded
- Deleted images may still remain visible in the gallery
- Renamed or moved files can cause broken or stale entries
- The database and UI can gradually drift out of sync
This can feel confusing and unreliable for users, especially for a gallery application whose core purpose is to accurately represent their media library.
Proposed Solution
Introduce a real-time filesystem watcher for user-added folders that listens for external changes and updates PictoPy automatically.
The watcher should:
- Detect newly added image files and index them immediately
- Remove images from the database when files are deleted
- Update records when files are renamed or moved
- Keep the UI and database synchronized without full rescans
- Provide a fallback manual “resync” option if watching fails
Why This Is Valuable
- Improves user trust by ensuring PictoPy always reflects the actual filesystem
- Eliminates manual refresh steps and confusion
- Prevents long-term database inconsistencies
- Brings PictoPy closer to professional-grade photo management tools
This enhancement focuses on reliability and user experience, rather than just adding new UI features.
Possible Implementation Direction
- Use a cross-platform filesystem watcher compatible with PictoPy’s architecture
- Emit add/delete/rename events and update SQLite incrementally
- Debounce rapid events to avoid performance issues
- Gracefully handle watcher interruptions or permission errors
(Implementation details are flexible and open for discussion.)
Contributor Intent
I’m interested in working on this issue and would love mentor guidance on design decisions and edge cases. I’m happy to iterate on the approach based on feedback and contribute a clean, well-tested implementation.
Additional Context
This feature addresses a common pain point around filesystem and database consistency and aims to proactively prevent such issues rather than fixing them after they occur.