[RELEASE] Texture Cache Maintenance utility
@Milhouse
thx for your quick answer.
Quote:
(2015-11-18, 00:10)Nepomuk Wrote: can you make a example for a windows-batch-file where more then on command is in use please?

It's just a text file, one command on each line...

Code:
@echo off
c:\texturecache.py c movies
c:\texturecache.py c tvshows
c:\texturecache.py imdb movies | c:\texturecache.py set
c:\texturecache.py imdb tvshows | c:\texturecache.py set
In one batch-file? So the batch processing the commands step by step? I mean process the 1. step, waiting until 1. step is finished, the 2. step and so on?
The 3. and 4. command will update the imdb information, that are defined in the cfg-file. Is that right? And where will the script write the updated informations - only in the kodi media libary (Mysql-db) or in the movie.nfo too?

Quote:would work, assuming you have texturecache.py and (if needed) texturecache.cfg in c:\, and the python path is added to your PATH variable (see guide for Windows users).

(2015-11-18, 00:10)Nepomuk Wrote: Where I can use the sep = | in the texturecache.cfg? For what's that seperator?

I have tried to persuade people *NOT* to use values in their texturecache.cfg that they don't need (because they're the same as the default value), or understand. I've provided a sample file on github, which was probably a mistake, and it's not intended that you use it verbatim/as-is - most people don't need a configuration file at all.
I don't use the cfg file but I will understand for what this variables are and what I can change here.

Quote:Regarding the sep field, it's the separator between fields in the output from the "s" option, eg.:
Code:
./texturecache.py s avatar @sep=#
014301#f/f6fd12f4.png#0562#1000#0002#2015-07-10 03:27:49#2015-07-10 04:27:48#nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-clearart.png
014829#0/05ae89b1.png#0310#0800#0002#2015-07-10 03:31:25#2015-07-10 04:31:10#nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-logo.png
015466#d/d843551b.jpg#0000#0000#0294#2015-09-13 22:27:39#2015-09-13 23:27:01#nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-fanart.jpg
016161#c/cfdfd21f.jpg#0000#0000#0329#2015-10-26 08:23:13#2015-10-25 23:27:09#nfs://192.168.0.3/mnt/share/media/Video/MoviesSD/Avatar (2009)[DVDRip]-poster.jpg
Matching row ids: 14301 14829 15466 16161

I very much doubt there's any reason to change the value of sep, but the option is there...
Now I understand that and I don't need the var sep.

Quote:
(2015-11-18, 00:10)Nepomuk Wrote: When I have a texturecache.cfg in the same folder as texturecache.py - have I use it in the command string like e.g. "texturecache.py C movies @config=texturecache.cfg" or can I omitting "@config=texturecache.cfg"?

No, it will be used automatically. If you use the "config" option it will display the name and path of the texturecache.cfg being used:
Code:
~/projects$ ./texturecache.py/texturecache.py config
Current properties (if exists, read from /home/neil/projects/texturecache.py/texturecache.cfg):
...

The @config property is only needed when the configuration file is not found in one of the default locations, or is not using the default name (texturecache.cfg).
Thx for this declaration.

Quote:
(2015-11-18, 00:10)Nepomuk Wrote: I have scraped my movies and TVshows with EmberMediamanager and not with kodi. So all needed files e.g. movie.nfo, movie-fanart.jpg, movie-clearlogo.png ... are local in every movie folder. The Thumbnails-Folder is substitute to my server. This folder blow up more and more. Now I want to synch mysql-kodi-db and every local Textures13.db with the movie files.

Path substitution of the Thumbnails folder when shared between multiple clients is explained quite clearly in the Kodi Wki (see contents of the orange box) as being an unsupported option, and one that doesn't work. Just stop using it, and use local Thumbnails folders on each client or provide each client with their own network folder, but whatever you do, do not share Thumbnails folders.
Thats right and I had read this notice. And I know that this method is unsupported by kodi. In the paste the only problem I get was that after some month several arts are not present at some clients, so I deleted the Thumbnail-folder and the textures13.db on every client, but I got the tip to use your script to hold folder and db clean.

Quote:
(2015-11-18, 00:10)Nepomuk Wrote: I do not want that texturecache.py download informationen from the WAN and save this in the different db's or in the .nfo-file. Do I need a special parameter that texturecache.py read/use only the local files or informations?

If you don't want the script to cache remote artwork (ie. artwork where the path begins with http) then add the following to your texturecache.cfg:
Code:
cache.ignore.types=+^http

and this will add (hence the +) the ^http pattern to the existing ignored "types" (the default value is " ^video, ^music", which ignores embedded video and music artwork, as these can't be cached by this script).
That's fine when I can block it by adding this string to cfg-file.

Quote:
(2015-11-18, 00:10)Nepomuk Wrote: Does texturecache.py synch the extra-arts and special-arts like extrathumb.jpg or clearlogo.png too?

Yes, "extra-arts" will be cached if you add the following to texturecache.cfg:
Code:
cache.extrafanart = yes
cache.extrathumbs = yes

Also, VideoExtras is supported:
Code:
cache.videoextras = yes

The default for all of the above settings is "no".

"special-arts" (clearlogo.png etc.) will be cached automatically, as will any artwork type referenced by your media library, eg. discart, clearart etc.

Use "cache.artwork" to cache specific artwork, eg. "cache.artwork=poster,fanart" would cache only poster and fanart - the default is to cache all artwork referenced by the media library.

Note that extrafanart/extrathumbs/videoextras artwork is not referenced by the media library, hence the separate options to enable this functionality (which is barely tested, by the way, as I doubt anyone has used it until now...).
Thx, I will added this three strings to cfg-file.
Where I can enable the separate options for extrafanart/extrathumbs/videoextras artwork in kodi? I have this files in the movie-folders but I don't find this option in kodi itself.

Quote:
(2015-11-18, 00:10)Nepomuk Wrote: I do not understand the principle/expiration of texturecache.py.
Does the script look first in the kodi.db (mysql-db), find the path to a movie, synch then textures13.db
or
does the script look in the movie sources first then add/synch the informations in kodi.db then synch textures13.db?

The former - the script compares the artwork paths from the media library against the artwork paths from the texture cache, and caches whatever is missing. In the case of extrafanart/extrathumbs/videoextras artwork, the script scans the directories for the relevant artwork (and then compares against the texture cache).
Now I understand the method of your script more - a little bit more. Big Grin

(2015-11-18, 06:27)Milhouse Wrote:
(2015-11-18, 03:31)MANswers Wrote: By the way, can i ask a very basic stupid question, whats the point of cleaning your thumbnails? what thumbnails? why use this utility, how does it benifit

Kodi caches artwork - both local (LAN) and remote (http) artwork - in the "texture cache" which consists of a local database (Textures13.db) and the Thumbnails folder. It does this for a few reasons, though mainly to improve performance when displaying artwork as Kodi doesn't have to keep downloading it from the web or local LAN each time, also so Kodi can optimise the format and size of the cached artwork suitable for the display device (low powered devices might use smaller, lower quality artwork than a "big" i7 system, or might be able to hardware decode some jpg formats but not others - the cached artwork will always be hardware decodable).
The best would be when we can change this in the kodi-options - maybe in the future. Angel

Quote:Unfortunately Kodi isn't very good at removing old items from the texture cache - each time you browse through the available videos in the YouTube add-on, those thumbnails of YouTube videos are being added to your cached, and are never removed. Movies or TV Shows and episodes that are removed from the library never have their thumbnails removed from the cache. This can lead to the cache "bloating" with hundreds, possibly thousands, of thumbnails you'll never display again.

This "bloat" can result in the cache increasing in size to many GBs, and some systems, eg. Apple TV, Android etc., have only limited space available for the texture cache, so "cleaning" the cache every now and again is a means to reclaim the available space by deleting the thumbnails you no longer need, while still keeping the thumbnails you do use.

It's probably worth cleaning the cache once a month. You can schedule this script to run using cron (or whatever the Windows equivalent is), either on the Kodi client itself or from a central system. The command to clean the texture cache is "texturecache.py P" (P for prune, as that's what it does... selectively getting rid of the useless stuff). It's not a quick process, as it has to do a lot of work and can take a few minutes, so running it overnight when you're not using the systems would be advised - you certainly don't want to run it at startup.

Once you've started to schedule one maintenance job, scheduling others becomes a piece of cake... pre-loading the cache with all artwork ("texturecache c"), updating imdb ratings and votes for movies and tvshows, eliminating artwork from the cache that Kodi has forgotten about ("texturecache.py R") or that Kodi thinks is in the cache when it's not ("texturecache.py Xd" - although this last one is best run on the client itself), etc. etc.
Are this your recommend commands AND in that order to hold Thumbnails-folder and local texture13.db clean and up to date:
With only this texturecache.cfg:
Code:
cache.ignore.types=+^http
cache.extrafanart = yes
cache.extrathumbs = yes
cache.videoextras = yes
cache.castthumb = yes
Code:
@echo off
texturecache.py P
texturecache.py c movies
texturecache.py c sets
texturecache.py c tvshows
texturecache.py imdb movies | c:\texturecache.py set   <-- maybe only who want this
texturecache.py imdb tvshows | c:\texturecache.py set  <-- maybe only who want this
texturecache.py R
texturecache.py Xd
What is with the "qa" or "qax" command - I don't use it or it's better to insert in the bath file and when so in which order?
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 Nepomuk - 2015-11-18, 14:33
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