Page MenuHome

File Browser: change location of thumbnail file cache
Needs ReviewPublic

Authored by Ankit Meel (ankitm) on Nov 13 2021, 12:58 PM.

Details

Summary

BKE_appdir_folder_caches added recently replaces the manual cache
folder finding done here.
Simplify char array handling also.


OSOld PathNew Path
Windows%CSIDL_PROFILE%\.thumbnails%USERPROFILE%\AppData\Local\Blender Foundation\Blender\Cache\thumbnails or BKE_tempdir_base\Blender Foundation\Blender\Cache\thumbnails (note the removal of leading period)
Linux$XDG_CACHE_HOME/thumbnails or $HOME/.cache/thumbnails$XDG_CACHE_HOME/thumbnails or $HOME/.cache/blender/thumbnails or BKE_tempdir_base/blender/thumbnails/
macOS$HOME/.thumbnails~/Library/Cache/Blender/thumbnails or BKE_tempdir_base/Blender/thumbnails (note the removal of leading period: makes the folder user visible)

Diff Detail

Repository
rB Blender
Branch
adopt_ghost (branched from master)
Build Status
Buildable 19376
Build 19376: arc lint + arc unit

Event Timeline

Ankit Meel (ankitm) requested review of this revision.Nov 13 2021, 12:58 PM
Ankit Meel (ankitm) created this revision.
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)Nov 13 2021, 1:01 PM
Ankit Meel (ankitm) retitled this revision from imbuf: de-duplicate code, use GHOST BKE APIs for folders. to imbuf: de-duplicate code, use BKE APIs for directories.
Ankit Meel (ankitm) edited the summary of this revision. (Show Details)

Fix accidental breakage on windows

Ankit Meel (ankitm) edited the summary of this revision. (Show Details)Nov 14 2021, 10:29 PM

First I want to say that I really don't like where our thumbnails are stored currently on Windows platform, so I like any change. If Ray is happy with the new location, I am happy.

For background on the current location, we are attempting to follow a little-known common standard for thumbnail storage and location:

However, not sure of any other app that follows this. And I personally don't care if they do since I'd rather not share these with anyone else. If we make our copies private then we can deviate any way we want, store larger versions, etc.

Brecht Van Lommel (brecht) retitled this revision from imbuf: de-duplicate code, use BKE APIs for directories to File Browser: change location of thumbnail file cache.Nov 26 2021, 2:28 PM

I changed the title to clarify that this is not a refactor, it's a significant change in behavior. The refactoring is secondary.

The current location makes little sense to me also, and this seems better. Though it's unfortunate to leave behind a folder that takes up disk space, and regenerate all the thumbnails. But since this is potentially shared with other we also can't really move it I guess.

Using BKE_tempdir_base seems wrong to me, when would you actually end up using that?

$HOME/.cache/Blender/thumbnails should be lowercase .cache/blender to follow XDG naming conventions and be consistent with .config/blender.

Ankit Meel (ankitm) edited the summary of this revision. (Show Details)Nov 26 2021, 2:35 PM

The current location makes little sense to me also, and this seems better. Though it's unfortunate to leave behind a folder that takes up disk space, and regenerate all the thumbnails. But since this is potentially shared with other we also can't really move it I guess.

Will mention it in release notes.

Using BKE_tempdir_base seems wrong to me, when would you actually end up using that?

It's an implementation detail: comes from caches_root_path = BKE_tempdir_base();> Mentioned it in the description since there's a chance of it happening, while there wasn't earlier. https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/appdir.c;a773cd3850ee542f0bc919e67d1ec04221ec95a5$261

$HOME/.cache/Blender/thumbnails should be lowercase .cache/blender to follow XDG naming conventions and be consistent with .config/blender.

It was a typo in desc. Code does the same. https://developer.blender.org/diffusion/B/browse/master/source/blender/blenkernel/intern/appdir.c;a773cd3850ee542f0bc919e67d1ec04221ec95a5$273

Ok, looks good to me then.

Ankit Meel (ankitm) edited the summary of this revision. (Show Details)Dec 10 2021, 8:06 PM
source/blender/imbuf/intern/thumbs.c
94

Why is blender still appended here? it makes this rather strange path for me locally

C:\Users\ray\AppData\Local\Blender Foundation\Blender\Cache\thumbnails\fail\blender\

remove repeated blender from path