Skip to content

Conversation

@TheBobBobs
Copy link
Contributor

Summary

Fixes errors from multiple render threads adding/removing cache folders.
Fixes register_existing_folders only calculating the size for the last folder in the cache.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@CyanVoxel CyanVoxel added Type: Refactor Code that needs to be restructured or cleaned up TagStudio: Library Relating to the TagStudio library system Status: Review Needed A review of this is needed labels Aug 19, 2025
@CyanVoxel CyanVoxel moved this to 👀 In review in TagStudio Development Aug 19, 2025
Copy link
Member

@CyanVoxel CyanVoxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening this PR, the wonky threading is an internal issue of the current cache system that I've been wanting to have fixed since it was introduced.

However I am currently unable to review this further as it crashes when opening most libraries for me (macOS 15.5):
(There may be multiple issues occurring here)

2025-08-19 13:54:06 [info     ] [FFmpeg] Using FFprobe location: ffprobe (Found)
2025-08-19 13:54:06 [info     ] [FFmpeg] Using FFmpeg location: ffmpeg (Found)
2025-08-19 13:54:06 [info     ] [ResourceManager] Resources Registered: count=33
2025-08-19 13:54:06 [info     ] [Settings] Global Settings File Path not specified, using default
2025-08-19 13:54:06 [info     ] [Settings] Reading Global Settings File path=PosixPath('/Users/cyanvoxel/.config/TagStudio/settings.toml')
2025-08-19 13:54:06 [info     ] [Cache] Cache File not specified, using default one filename=/Users/cyanvoxel/.config/TagStudio/TagStudio.ini
2025-08-19 13:54:08 [error    ] [Errno 20] Not a directory: '/Users/cyanvoxel/Local Files/Projects/TagStudio Project/Test Libraries/Example 2/.TagStudio/thumbs/.DS_Store'
Traceback (most recent call last):
  File "/Users/cyanvoxel/Local Files/Dev/TagStudio/src/tagstudio/main.py", line 64, in main
    driver.start()
  File "/Users/cyanvoxel/Local Files/Dev/TagStudio/src/tagstudio/qt/ts_qt.py", line 556, in start
    self.open_library(path_result.library_path)
  File "/Users/cyanvoxel/Local Files/Dev/TagStudio/src/tagstudio/qt/ts_qt.py", line 1672, in open_library
    defaultValue=self.lib.cache_manager.max_size,
                 ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Library' object has no attribute 'cache_manager'
2025-08-19 13:54:08 [info     ] 
TagStudio Frontend (Qt) Crashed! Press Enter to Continue...

I am also able to "jam up" the cache deletion by tossing in a random file into the thumbs folder, causing a traceback. From what I can tell you're choosing to delete the entire thumbs folder now instead of each of the folders inside it, which is contributing to this problem.

@TheBobBobs
Copy link
Contributor Author

This should now work with random files in the cache folder. As well as cache folders being deleted outside of tagstudio.
I ended up just removing the bytes to megabytes conversion.

@CyanVoxel CyanVoxel added this to the Alpha v9.5.4 milestone Aug 26, 2025
@CyanVoxel CyanVoxel removed the Status: Review Needed A review of this is needed label Aug 26, 2025
Copy link
Member

@CyanVoxel CyanVoxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to be functional now, thank you for your work on this! I've just resolved the merge conflicts with #1057 and will get this merged.

@CyanVoxel CyanVoxel merged commit 3125a99 into TagStudioDev:main Aug 27, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in TagStudio Development Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TagStudio: Library Relating to the TagStudio library system Type: Refactor Code that needs to be restructured or cleaned up

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants