This tool does not work for XBMC Frodo or greater. Please use the excellent Texture Cache Maintenance Utility
***See 2nd post for my script to clean up unused thumbnails and fanart***
My Thumbnails folder is growing larger and larger. I'm guessing a lot of the images in there are no longer used, as i have a pretty high turn-around rate for my library content.
Is there any standard way to determine which images in the userdata/Thumbnails folder are no longer used? Or some process to clean them out?
If there isn't a standard way, I will attempt to do it myself, but i need some help. I need to determine what all the valid hash's are, so i can determine which ones can be removed. To do this, I need to determine the CRC hash for every item in XBMC's library that can have a thumb/fanart image.
So far I think I know:
- Movies, episodes, and music videos use the actual path to the file to generate a CRC hash, for example "smb://server/share/videos/movie/Avatar.mkv" = 1c145e0e. Fanart is stored under the fanart subfolder using the same hash.
- If the video is a multi-part video, the name only (e.g: stack://part1.ext , part2.ext...) is used to generate the CRC (the path string is ignored)
- Actor thumbs use the "actor" + [actor name] to generate the CRC, for example Jane Lynch = "actorjayne lynch" = 9f309464
- Album thumbs are (usually) [album]+[artist] and are also stored in the database under the strThumb field.
- Album/song thumbs may be taken from a folder.jpg image, and may be generated from the folder path or the song path. More info here on album/song thumbs.
- Artist fanart is generated using the literal artist name, for example "Metallica" = b18ea041.
- Artist thumbs are generates using "artist"+[artist name], for example Metallica = "artistmetallica" = 0a2d8dbc.
- Video Bookmark thumbs store their path in the thumbnailImage field in the database. I'm not sure how it is originally generated
- TV Show seasons use "season" + [path_to_show] + [season_label]. See here for details
- TV Show banners/fanart use the literal path to the show, for example "smb://server/TV Shows/Lost/". Fanart is stored under the fanart subfolder using the same hash.
I need to figure out:
- Are there any other image types I'm missing that get stored in the Thumbnails folder?
I plan on deleting all auto-xxxxxxxx.tbn images since they can be recreated automatically if XBMC needs them.