[RELEASE] Texture Cache Maintenance utility
(2013-11-24, 16:22)redglory Wrote: Hi,

First of all just the script I most miss in XBMC as it is quite hard to replace and re-cache fanart in every movie (doing it manually i PITA)

I already have my desired fanart inside every movie folder locally. Would like to know the command to re-cache my movie and tvshow art replacing possible remote ones with my local art. Looking forward to also prune unused art to free some space.

I scrape my fanart using EmberMM (using CPS post-processing script) and i also update XBMC library but sometimes like to change fanart and would like to reload it automatically (using your script) on XBMC.

Great work! Smile

If you want to replace your remote artwork with local artwork, you can use the mklocal.py script (which is in the tools folder on github. Download the source code and if using Linux, apply the correct permissions: chmod +x ./mklocal.py.

This script exists to download remote artwork to your local filesystem, but it will only do so if local artwork doesn't already exist (ie. it won't overwrite) so in your case there should be nothing to download. Also, having determined the availability of the relevant local artwork, the script can generate "workitems" to be passed to "texturecache.py set" in order to update your media library with the new local urls.

As your artwork is already available locally, you'll want to pass the --readonly switch so that mklocal.py won't download any of your current remote artwork and will only use whatever it finds locally. If you don't pass --readonly, it will download the remote artwork for artwork types that don't already exist locally, so you could leave it off and mklocal.py will then "fill in" any gaps in your local artwork collection by downloading whatever is missing. Probably best to specify --readonly to begin with though, at least until you feel comfortable with how it all works.

The trickiest part is mapping your XBMC source to your OS mount point, which is done with the --prefix and --local switches. For instance my XBMC source is "nfs://" and the equivalent OS mount point is "/freenas/media" so the relevant switches for me are "--prefix nfs:// --local /freenas/media". This means the script can map "nfs://" to "/freenas/media" and vice versa. It only requires this mapping in order to gain read/write access to your local media, all XBMC urls will retain their current prefix (nfs:, smb:, whatever).

I would suggest working with just a single movie until you get the hang of things.

Then it's just a case of "feeding" mklocal.py a list of movies or tvshows to process, eg:
./texturecache.py jd movies avatar | ./mklocal.py --readonly --prefix nfs:// --local /freenas/media --artwork poster fanart --output

The above command would output "workitems" for the movie Avatar IF any changes are required.

mklocal.py doesn't update your media library itself, it can only generate the "instructions" which must then be processed by "texturecache.py set". Example output from mklocal.py might be:
    "items": {
      "art.poster": "nfs:// (2009)[DVDRip]-poster.jpg"
    "libraryid": 23,
    "type": "movie",
    "title": "Avatar"

which is an instruction to set a new poster url on the movie.

Add "--season" and/or "--episode" switches if you want to also process artwork for your tvshow seasons and episodes.

Add additional artwork types (clearart, clearlogo, discart etc.) as you see fit.

Add the "-v" switch to view debug output and whatever processing is taking place.

See "./mklocal.py --help" for more details.

Once you are happy with how mklocal.py is working, pass the output to "texturecache.py set" in order to apply the changes to your media library, eg.:
./texturecache.py jd movies | ./mklocal.py --readonly --prefix nfs:// --local /freenas/media --artwork poster fanart --output | ./texturecache.py set

though note that JSON support for the modification of season art isn't supported until JSON API v6.10.0, which means a recent Gotham nightly - any attempts to change season art pre-v6.10.0 will result in a warning from "texturecache.py set" and the season art request will be ignored.

Updating movies via JSON can be quite a slow process and running workitems through "texturecache.py set" can take a while!

Once you have made changes to your media library you'll want to pre-load the cache with the now local artwork ("./texturecache.py c movies"), and finally prune your cache to remove all trace of the old remote artwork ("./texturecache.py P").

So just to be clear: As long as you pass "--readonly" to mklocal.py, no modifications will be made to your local filesystem. And as long as you don't pass anything to "texturecache.py set" no changes will be applied to your media library.
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.

Messages In This Thread
RE: [RELEASE] Texture Cache Maintenance utility - by Milhouse - 2013-11-24, 20:01
Crash on Gotham on OS X - by desepticon - 2014-05-29, 17:57
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 utility17
This forum uses Lukasz Tkacz MyBB addons.