[RELEASE] Texture Cache Maintenance utility
(2014-05-13, 15:40)creesy Wrote: MilhouseVH anychance you could explain to me how to use mklocal.py?

Not very good with this took me long enough to learn how to use texture cache Tongue

Try reading this post which covers the basics.

Work with just one movie (or tv show) to begin with, specify a --local directory that isn't your real movie library path, check the output, and once you're happy with it then use your actual movie library path and download the remote artwork for your movies. The output generated by mklocal.py can be fed into "texturecache.py set" which will then apply the changes to your media library, after which you can run "texturecache,py c" to pre-load the cache with your new local artwork.

If you don't want to download anything but just want to associate your movies/tvshows with already existing local artwork then include the --readonly argument.

Add the --nokeep argument if you want to remove artwork from your media library that is no longer available remotely or locally.

Add the -singlefolders argument if your movies are in single folders - this will mean newly downloaded artwork is named "logo.png" instead of "<movie-name>-logo.png" etc.

Add the --season or --episode arguments if you want to process season or episode artwork for your tv shows (optionally specifying additional artwork types for season and/or episodes).

Here's the usage for mklocal.py (v0.2.2):
Code:
usage: mklocal.py [-h] [-l DIRECTORY] [-p PATH] [-A PATH] [-i [FILENAME]] [-o [FILENAME]]
                  [--dryrun] [-r] [--ignorebadprefix] [-a TYPE [TYPE ...]]
                  [-c TYPE [TYPE ...]] [-s [TYPE [TYPE ...]]] [-e [TYPE [TYPE ...]]] [-1]
                  [-nk] [--info] [-q | -v]

Downloads specific artwork types (default: clearart, clearlogo) based on urls in media
library (ie. original source) creating local versions. Avoids retrieving artwork from XBMC
Texture Cache as this is often resized, resampled and of lower quality. Optionally output
data that can be used to update the media library to use new local versions of artwork,
replacing any current remote versions. The same data will also remove invalid remote
artwork from the library.

optional arguments:
  -h, --help             show this help message and exit
  -l DIRECTORY, --local DIRECTORY
                         Local DIRECTORY into which artwork will be WRITTEN, eg.
                         /freenas/media/
  -p PATH, --prefix PATH
                         XBMC PATH prefix (eg. nfs://192.168.0.3/mnt/share/media/) that
                         will be substituted by --local DIRECTORY when traversing media
                         files. This is typically the root of the media source as defined
                         in sources.xml
  -A PATH, --altlocal PATH
                         Alternate local directory which may contain artwork that can be
                         READ and copied to --local, could be the original source folder
  -i [FILENAME], --input [FILENAME]
                         Optional FILENAME containing JSON movie/tvshow data for
                         processing. Read from stdin if FILENAME is - or not specified
  -o [FILENAME], --output [FILENAME]
                         Output a data structure suitable for consumption by
                         texturecache.py [test]set, used to update an XBMC media library
                         converting remote urls into local urls. Written to stdout if
                         FILENAME is - or not specified
  --dryrun               Don't create anything (although downloads will be attempted)
  -r, --readonly         Don't download (or, if specified, copy from --altlocal) new
                         artwork, only use existing --local artwork
  --ignorebadprefix      Don't display a warning for media files with a path that does not
                         match that set by --prefix
  -a TYPE [TYPE ...], --artwork TYPE [TYPE ...]
                         Artwork TYPE(s) for download, eg. "--artwork discart banner"
                         Specify TYPE:SUFFIX if SUFFIX differs from TYPE, eg. "--artwork
                         thumb:poster" would create "thumb" library items with a "-poster"
                         filename suffix
  -c TYPE [TYPE ...], --check TYPE [TYPE ...]
                         Check the named artwork TYPE(s) - or "all" - and warn if any
                         internet (http) URLs are detected
  -s [TYPE [TYPE ...]], --season [TYPE [TYPE ...]]
                         For TV Shows, process season items (default: poster banner
                         landscape)
  -e [TYPE [TYPE ...]], --episode [TYPE [TYPE ...]]
                         For TV Shows, process episode items (default: thumb)
  -1, --singlefolders    Movies are in individual folders so don't use the movie-name as a
                         prefix
  -nk, --nokeep          Don't keep artwork if not able to match with pre-existing local
                         artwork
  --info                 Display informational output to stdout
  -q, --quiet            Silence warnings about missing artwork (NEEDED etc.)
  -v, --verbose          Display diagnostic output

Minimum required arguments are --local, --prefix, --artwork (and --input, which if not specified is read from stdin).

For example, the following would download any remote artwork of the poster/fanart/clearart/clearlogo variety to a movie library rooted at /freenas/media, then associate any already existing or any just downloaded artwork with each movie, outputting changes to newartwork.dat:

Code:
./texturecache.py jd movies zombieland | ./mklocal.py --local /freenas/media --prefix nfs://192.168.0.3/mnt/share/media --artwork poster fanart clearlogo clearart --output newartwork.dat"

To apply the artwork changes to your media library:
Code:
cat newartwork.dat | texturecache.py set

then sit back as it can take a while to apply all of the updates! Hopefully future versions of Helix will be much, much faster.

Finally, pre-load your cache with the new artwork.

Give it a go, come back with any specific questions if you have any! Smile
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


Messages In This Thread
RE: [RELEASE] Texture Cache Maintenance utility - by Milhouse - 2014-05-13, 16:23
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