[RELEASE] Texture Cache Maintenance utility
Literally everything you see in the GUI will come from the texture cache, even when it is available locally on the LAN.

Whenever an item of artwork has to be displayed in the GUI, Kodi will first check the texture cache and if it's not present it will "download" the artwork - this might mean downloading from a remote internet web site, or copying it from your local LAN - and then store a new version of the artwork in the local cache. There will be some image/format conversion and resizing during this process - the version stored in the cache is *not* an exact copy of the original artwork, it will usually be lower quality in one way or another, but also optimised for display on your particular Kodi device (this is another reason why the texture cache is device specific and should not be shared).

Once the artwork is found in the cache, the cached version will be displayed in the GUI - the original artwork is never displayed in the GUI.

When pre-loading the texture cache using this script, all the script is doing is connecting to the Kodi webserver and asking Kodi for a copy of the artwork. If Kodi determines that the artwork is not present in the local texture cache then it will download the original artwork (from the web site, or local LAN) and cache it before serving up the cached artwork. Voila, the texture cache is now populated, mission accomplished.

The script doesn't actually do anything with the artwork that Kodi serves up, and in fact the script only downloads the first 1024 bytes (it could probably get away with just a HEAD request which would transfer even fewer bytes). This is also why when Kodi can't access an item of artwork (no longer available on a remote web site or locally, or the file permissions prevent Kodi from accessing it locally) the script has *no idea* why the artwork cannot be downloaded as it's not accessing the artwork directly - all the script knows is that Kodi failed to serve up the requested artwork.

(2016-01-20, 05:31)gjwAudio Wrote: SideQuestion: What do I add to the CFG file to have any ExtraThumbs or ExtraFanArt listed ?

To cache both:
Code:
cache.extra=yes

If you only want to cache ExtraFanart but not ExtraThumbs:
Code:
cache.extrafanart=yes

and if you only want to cache ExtraThumbs...

Code:
cache.extrathumbs=yes

(2016-01-20, 05:31)gjwAudio Wrote: Ahhhh... do you mean "all files named in the Textures database" -OR- "all the local files found within the media folders" ?

Definitely not the former.

And the wording of the latter is open to interpretation - are you talking about the media library *database* or do you really mean the media library folders (files and directories)? The script will cache the artwork that is in the media library database, ie. MyVideos93 etc. - this artwork must have been added to the database by either scraping/scanning or manually adding with "Choose art" (or possibly by an addon such as Artwork Downloader).

If artwork isn't in the media library database then it can't be cached by Kodi or this script as Kodi knows nothing about the artwork until it is added to the media library database.

(2016-01-20, 05:31)gjwAudio Wrote: Last night I ran the "./texturecache.py c movies" command, and it did not seem to put my homemade banner into the cache. I then used the context menu to "Choose art' and select the banner... Is this the operation that finally wrote it into the database ?

Yes, the order is all important here. You can't cache something that doesn't exist (isn't known about). The banner didn't exist (as far as Kodi is concerned) until you added it with "Choose art". Normally this process would/should add it to the cache (as the GUI should have to display the artwork to you once you've associated it with your movie, but this doesn't always happen).

Running the script with "c movies" will populate the texture cache with any artwork present in the media library database that isn't yet in the texture cache database.

(2016-01-20, 05:31)gjwAudio Wrote: FromAnotherAngle: I take it that if an image is NOT found in the Thumbnails folder, kodi CANNOT put it on the screen.

Correct. Worse than this is when there is a row in the Textures13.db that references a file in the Thumbnails folder and the file doesn't exist - then Kodi becomes very confused (you can fix this with "texturecache.py Xd"). So if you were to delete files from Thumbnails without deleting the corresponding rows from the Textures13.db you'd be pretty badly screwed (or rather, your Texture Cache would).

(2016-01-20, 05:31)gjwAudio Wrote: Many times I've had to repeat the "Choose art" steps for these homemade images, because something has knocked them out. I've made it a frequent practice to clean the library and export everything to local files.

To be honest with you I've never exported my library, not once.

I do however know that exporting the artwork from the texture cache will result in a drop in image quality, and if you were to do this repeatedly (export with artwork overwrite, then re-scrape, and repeat the export) then you've potentially got multi generational reductions in image quality. One advantage of exporting artwork from the library is that remote artwork becomes local artwork (albeit at a lower quality than the original), however if you want this remote artwork to be stored locally in the original quality then I suggest you look at mklocal.py (see link at bottom of first thread).

That being said, as long as you don't overwrite your original local artwork you shouldn't have too much to worry about.

(2016-01-20, 05:31)gjwAudio Wrote: Is it possible my homemade art is not being recorded in the local NFOs, and at some time in the future a re-scrape wipes it out from the database & Thumbnails folder ? (grasping at straws here Frown )

There's no need for there to be a link in the NFO if the artwork is named correctly as Kodi will automatically find and use it based on the filename.

However, the issue you are most likely experiencing when re-scraping your movies is that "banner" is not a standard or supported artwork type for a movie (I know the wiki suggests banner is supported for movies but best I can tell it's not, at least not by Universal Movie Scraper which is what I use). No amount of exporting and/or re-scraping will scrape a movie and automatically associate it with your local stored banner artwork, NFO reference or not (TV shows do however support banner artwork and also landscape).

The stock Kodi scanners only associate "fanart" and "poster" artwork with movies. Anything else - banner, discart, clearlogo, clearart etc. etc. - are all ignored and will not be automatically associated with movies.

So when you re-scrape/refresh a movie you're going to lose all your non-standard artwork types, ie. your banner, whether it's in your NFO or not. This is where you need to re-associate the banner artwork manually using "Choose art..." in the GUI, or use an add-on like Artwork Downloader to re-associate non-standard artwork types (but this has other consequences - too many to go into now, read the AD thread or maybe just my posts... Smile). Or again there is mklocal.py, which can automatically associate any artwork type it finds in your local file system - knock up a small script that calls "texturecache.py vscan" then mklocal.py followed by "texturecache.py c movies" and you shouldn't have any more problems with non-standard artwork.
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
 
Thread Rating:
  • 17 Vote(s) - 4.76 Average


Messages In This Thread
Crash on Gotham on OS X - by desepticon - 2014-05-29, 17:57
RE: [RELEASE] Texture Cache Maintenance utility - by Milhouse - 2016-01-20, 07:03
Cleaning - by AleisterHH - 2018-05-28, 22:03
RE: Cleaning - by Milhouse - 2018-05-28, 22:16
qax genre not updated - by Just-Me_A-User - 2018-06-12, 22:06
RE: qax genre not updated - by Milhouse - 2018-06-12, 23:40


Logout Mark Read Team Forum Stats Members Help
[RELEASE] Texture Cache Maintenance utility4.7617