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

Merged
merged 11 commits into from
Jan 27, 2025
Merged

feat(ui): add thumbnail caching #694

merged 11 commits into from
Jan 27, 2025

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
@CyanVoxel CyanVoxel added Priority: High An important issue requiring attention and removed 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 labels Jan 23, 2025
@CyanVoxel CyanVoxel removed the Status: Review Needed A review of this is needed label Jan 27, 2025
@CyanVoxel CyanVoxel merged commit 4c337cb into main Jan 27, 2025
10 checks passed
@CyanVoxel CyanVoxel deleted the thumb-cache branch January 27, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High An important issue requiring attention 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: ✅ Done
1 participant