Skip to content
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(ui): add thumbnail caching #694

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

feat(ui): add thumbnail caching #694

wants to merge 7 commits into from

Conversation

CyanVoxel
Copy link
Member

@CyanVoxel CyanVoxel commented Jan 9, 2025

Summary

This PR adds the ability for file thumbnails to be cached inside a new thumbs folder within a library's .TagStudio directory. This cache used when possible to quickly update the thumbnails shown in the preview grid. Images in the Preview Panel still get rendered directly from their source files for maximum resolution. The main features of this process include:

  • Cached thumbnails for files based on the filename and modification date of the files
  • A total size limit for the cache (TODO: Make this user-configurable) where the earliest cached files are deleted when reached
  • A menu option to clear the cache (TODO: Move this to a future settings screen)

Known Issues

  • Audio waveform thumbnails no longer show their intended bar count due to always being passed a consistent size argument
  • Every now and again I get a reproducible segfault-like crash with no traceback when casually using the program. I assume it's related to this PR but can't verify

Additional Considerations (TODO)

  • Users should be able to configure where the thumbnail cache is stored
  • Users should be able to specify the resolution and filetype of the cached thumbnails
  • Users should be able to clear the cache from inside the program
  • Users should be able to disable caching
  • The program should be able to detect modified files and update the cache appropriately
  • The cache should probably have a size limit
  • There should be a way for the program to automatically clear old and/or orphaned thumbnails

Closes #104, Closes #345


NOTE: This PR is currently awaiting the merging of #647 in order to add the thumbnail cache options to the new settings config.

@CyanVoxel CyanVoxel added Type: QoL A quality of life (QoL) enhancement or suggestion Type: UI/UX User interface and/or user experience Priority: Medium An issue that shouldn't be be saved for last Type: File System File system interactions labels Jan 9, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.5 (Post-SQL) milestone Jan 9, 2025
@CyanVoxel CyanVoxel marked this pull request as ready for review January 13, 2025 20:51
@CyanVoxel CyanVoxel added the Status: Review Needed A review of this is needed label Jan 13, 2025
@CyanVoxel CyanVoxel added the Status: Blocked This issue or pull request is awaiting the outcome of another issue or pull request label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium An issue that shouldn't be be saved for last Status: Blocked This issue or pull request is awaiting the outcome of another issue or pull request Status: Review Needed A review of this is needed Type: File System File system interactions Type: QoL A quality of life (QoL) enhancement or suggestion Type: UI/UX User interface and/or user experience
Projects
Status: 🏓 Ready for Review
1 participant