Jump to content

Instructions to cache images


xnappo

Recommended Posts

xnappo

Can someone please post the instructions on how to use the texture tool to add backgrounds to the cache so things like 'random movies' work without manually scrolling through the library?

 

xnappo

Link to comment
Share on other sites

xnappo

I know how to do it :) I am asking someone to write up the steps for JUST fixing the images for our addon.

 

I will do it if no one volunteers.  The full power of the tool is going to be intimidating to new users.

Edited by xnappo
Link to comment
Share on other sites

im85288

Hopefully the readme is enough, but basically this command is enough to cache all images:

./texturecache.py c
Link to comment
Share on other sites

xnappo

Yes.. But what should the config file look like?  How do you get Python for Windows?  Can you run it from another machine?  How many threads should you use?  

 

I am asking that a user writes up a easy to use how-to with screenshots etc etc.

 

xnappo

  • Like 1
Link to comment
Share on other sites

im85288

Fair enough, but from my usage there's no config file needed, no need to install Python (included with openelec) or no need to worry about how many threads to use.

 

I'll leave this for someone who thinks it is more complicated to respond.

Link to comment
Share on other sites

Kent

Looking at setting this up tonight on my Win7 server if I get a chance.  Will try to write up something simple and post it.

 

In scope:

 

  • Python verification (I have Headphones installed which requires python, not sure if it's a compatible version though)
  • .bat file to kick off prune and cache functions for texturecache.py on system start-up (daily reboot)
  • within the .bat triggering texturecache,py on three clients, two Win7 clients and a Fire TV (remotely of course from the central server)
Link to comment
Share on other sites

Kent

Well, got as far as I could with it.  Came across an issue with JSON RPC. texturecache.py is telling me "The task you wish to perform requires that the JSON-RPC server" but all appears to be running and on port 9090.  Have to figure it out later.

 

Instructions are fairly straight forward:

 

1) Install python if you don't already have it.

https://wiki.python.org/moin/BeginnersGuide/Download

2) Configure Kodi's services (webserver & Remote Control):

- In Kodi 14.2, go to settings>Network>Webserver

- Enable the Webserver, check the port (8080 is default for texturecache.py), clear the username field or put your own in along with a password. They both can be left blank though

- go to Remote control and enable both options to Allow programs to control Kodi (on this system and on other systems)

- back out and restart Kodi

3) download texturecache.py from https://github.com/MilhouseVH/texturecache.py

4) Install it anywhere

5) In windows, open a CMD prompt, CD to where texturecache is and run it using something like texturecache.py c

Note: read the ReadMe or the following thread to get more information on how to run it if you have a custom webserver port, username or password, or you want to increase the threads or run it for Kodi install on another machine.

http://forum.kodi.tv/showthread.php?tid=158373

  • Like 1
Link to comment
Share on other sites

xnappo

You need to go into Settings->Services->Remote control and turn on 'Allow programs on other systems to control Kodi'. A restart is required to turn it on.

 

5559d81796d50_remote.png

Edited by xnappo
Link to comment
Share on other sites

kolbasz

Not to sound completely ridiculous, but can someone explain what this is to me?  If I understand it and its benefits, I am willing to test it and document it.

 

If I understand it, it would seem that kodi caches images and then never bothers to update them?  So in our case, after a sync, new images are never loaded unless the media is new/different.  With this script, we are able to the db to be cleared and updated with the latest metadata images from the emby server, is that correct?

 

Again, I have no clue, so that is a guess, but I do know some of my movies appear without cover art, so if this fixes that, let me know and I will see if I can test it out.

Link to comment
Share on other sites

xnappo

The primary reasons to do this are:

 

1. Things like rotating 'random movie' art.  Skins use the database to display these and assume the images have been cached.

2. Speed - once the images are cached, everything runs a lot faster

 

It does also help with 'broken' cached images as well - you can tell it to FORCE a full refresh by using a capital 'C' in the command.

 

xnappo

Link to comment
Share on other sites

kolbasz

so, I use openELEC on rpi2/cubox, would it be accurate that what you want documented is executing ./texturecache.py c and then the automation of this, say nightly at 5am?

 

If yes, is there a way to know when it is completed, if it was successful and a log of what it actually did?

Link to comment
Share on other sites

dresden7

please forgive my ignorance, but is this possible to be run on kodi on an fire tv?

 

It sounds like I have to setup the script on a windows machine and then setup kodi on that machine and then adjust my kodi settings on the firetv to allow the windows version to control it.

 

 

Is this correct? 

 

Thank you

Link to comment
Share on other sites

kolbasz

since it can be downloaded in Arch, I do not believe there is a direct requirement for Windows.  It would seem it can run individually on local kodi/openelec system, but I am snot sure, waiting for confirmation.

 

please forgive my ignorance, but is this possible to be run on kodi on an fire tv?

 

It sounds like I have to setup the script on a windows machine and then setup kodi on that machine and then adjust my kodi settings on the firetv to allow the windows version to control it.

 

 

Is this correct? 

 

Thank you

Link to comment
Share on other sites

Kent

You can run it pretty much anywhere you can install python 2.7+.  For me, running it on my Emby server is ideal. One place to manage all of it.

 

You just have to open the webservice and JSON-RPC on all of your Kodi clients, and have Kodi running (on the client PC not the server!) when you use texturecache.py. 

 

2) Configure Kodi's services (webserver & Remote Control):

- In Kodi 14.2, go to settings>Network>Webserver

- Enable the Webserver, check the port (8080 is default for texturecache.py), clear the username field or put your own in along with a password. They both can be left blank though

- go to Remote control and enable both options to Allow programs to control Kodi (on this system and on other systems)

- back out and restart Kodi

 

You add the client's IP address to the command line when running and it'll do the job.

 

For example: texturecache.py @@XBMC.host=192.168.1.1 c -> examines and pre-loads missing images to the cache on the Kodi client running on 192.168.1.1

Edited by Kent
  • Like 1
Link to comment
Share on other sites

kolbasz

Running against my openelec system, is this a credentials issue or something else

sudo ./texturecache.py @[member="XBMC"].host=192.168.0.140 s "Dr. No"
FATAL: The task you wish to perform requires read/write file
access to the XBMC sqlite3 Texture Cache database.

The following sqlite3 database could not be opened:
/home/user/userdata/Database/Textures13.db

Check settings in properties file texturecache.cfg,
or upgrade your XBMC client to use a more recent
version that supports Textures JSON API.
Edited by kolbasz
Link to comment
Share on other sites

e123enitan

I am totally lost, i run openlec on Kodi, can someone write a dummy steps guide to follow as i am not sure where and how to start this process and what is expected once completed, this will greatly help users like me who may lack technical skills.

 

Appreciate your help in advance. :)

Link to comment
Share on other sites

kolbasz

I made the assumption that because I use yatse remote that all this necessary things are enabled for this to run, but if you run ./texturecache.py s it yells at you (well, it did me) that the http server needs enabled...

 

 

As a result, I need to do this tonight...unless someone gives an answer before then, I will report what I did if I get it to work.

Link to comment
Share on other sites

Kent

To all the non-windows peeps, sorry I can't help...I'm using windows.

 

Update on my end:

 

I finally got it going, some notes below.

 

Next is trying to figure out how to automate this considering it requires Kodi up and running on the client side but Kodi only spins up when a family member wants to watch TV!

 

Notes

  • had wrong syntax in my original command, that's why i was getting the JSON error
  • Then I came across a profile issue. Yes I used profiles, which requires @profile.name=<profile_name> in the command syntax or cfg file
  • But after update the command syntax and modifying the CFG to 15 threads, she ran OK, took about 30 minutes each to cache all missing images for each profile for each client, but good news is it takes 24 seconds when you run the command again so only caches missing images as long as you use lower case c
  • Syntax I use: texturecache.py @@XBMC.host=<ip> @profile.name=<profile_name> c
  • Example: cache missing image for Kent on one client: texturecache.py @@XBMC.host=192.168.1.15 @profile.name=Kent c
  • Example: cache missing image for Lillian on same client: texturecache.py @@XBMC.host=192.168.1.15 @profile.name=Lillian c
  • Example: prune images for Kent on one client: texturecache.py @@XBMC.host=192.168.1.15 @profile.name=Kent p
  • Example: prune images for Lillian on same client: texturecache.py @@XBMC.host=192.168.1.15 @profile.name=Lillian p

I will also look at creating property sections in the cfg and using @section=name in the command syntax to make it easier to run this for all profiles and clients in scope.

  • Like 2
Link to comment
Share on other sites

Kent

I made the assumption that because I use yatse remote that all this necessary things are enabled for this to run, but if you run ./texturecache.py s it yells at you (well, it did me) that the http server needs enabled...

 

 

As a result, I need to do this tonight...unless someone gives an answer before then, I will report what I did if I get it to work.

 

yes and all the remote control services as well:

 

2) Configure Kodi's services (webserver & Remote Control):

- In Kodi 14.2, go to settings>Network>Webserver

- Enable the Webserver, check the port (8080 is default for texturecache.py), clear the username field or put your own in along with a password. They both can be left blank though

- go to Remote control and enable both options to Allow programs to control Kodi (on this system and on other systems)

- back out and restart Kodi

Link to comment
Share on other sites

Kent

@@Kent what are you using as your players and server?

 

Server is Win7

 

Players are 2 Win7 clients and a FireTV (unrooted).

Link to comment
Share on other sites

kolbasz

Oh wow, you really are all in on Windows. I will see what I can put together tonight on Linux

Link to comment
Share on other sites

kolbasz

Just curious, is there ever a time I would want big C over little c?

 

for now, my crontab entry: 

 

0 6 * * * /appdata/texturecache.py @@XBMC.host=192.168.0.140 c > /appdata/texturecache.log

 

I will let it run and if I see it complete, I can note what I did;  pretty simple, about as basic as it gets, biggest question is max threads?  I know 15 was mentioned, but what sthe sweet spot before performance is degraded and also, what determines this number?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...