Caching thumbnails
#1
I'm writing an addon which will scrap various thumbnails from a popular website. I don't want to overload the site so I only want to scrape the files once or again if they go missing/are deleted.

I can download them to a file e.g. "mypluginname_uniqueid_small.jpg" and stuff it in some private directory but it seems like a bodge.

Is there any way to utilise XBMC's thumbnail cache easily with these filenames from Python? I can compute the unique id and ask to load the filename, then if I get a "file not found in cache" error, I can download the file. If the thumb file exists, I need to be able to pass it on to ListView to use. And, I need to be able to store new files in the cache.

I've looked over the API docs and can't see how it's done.

Thanks
Reply
#2
Xbmc automatically caches images displayed for 24hrs. If you want them cached longer than that, you'll have to do it yourself
Reply
#3
I wouldn't rely on the cached version - it can be resized/resampled and the quality reduced (eg. 1080 fanart resized to 720, or 1000x1500 posters resized to 256x384), so my advice would be to download the original file to a suitable local filename, then scrape in the local file which will be cached and, on some (lower powered) devices, resized/resampled as per the individual client device requirements.

Basically, your "bodge" is likely to result in better quality artwork than relying on the texture cache.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply

Logout Mark Read Team Forum Stats Members Help
Caching thumbnails0