• 1
  • 192
  • 193
  • 194(current)
  • 195
  • 196
  • 197
[RELEASE] Texture Cache Maintenance utility
Never used this tool before, so forgive me for the question.

For some reason, Kodi Matrix failed to cache same of my locally stored discart.png files. Which texturecache.py command do I use to check my movie library and add the missing artwork to my cache?

- As mentioned artwork is stored locally alongside the video files, and named correctly. I do not want to download new discart, just hash the currently available artwork stored on my disc. 

Your help would be much appreciated.
Reply
I run an SQL server feeding three heads. Two are PC, one is a Pi. I recently updated the Pi to LEv10 (the two PC's are already v10).

I ran "TC c" on the Pi after blowing away and copying the "thumbnails" folder from the main PC. 

I am seeing a lot of errors coming back from the scan. Are these errors from the remote server where it is trying to get the images from?

    Line 12649: 2021-12-22 17:10:02.131477:Thread-3  : preparedl.RECEIVED WEB DATA: 200, OK, {"error":{"code":-32602,"data":{"details":null},"message":"Invalid params."},"id":"preparedl","jsonrpc":"2.0"}
    Line 12658: 2021-12-22 17:10:03.704981:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12664: 2021-12-22 17:10:04.120038:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12676: 2021-12-22 17:10:04.748800:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12688: 2021-12-22 17:10:05.379666:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12712: 2021-12-22 17:10:06.451016:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12724: 2021-12-22 17:10:07.100469:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12736: 2021-12-22 17:10:07.758501:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12748: 2021-12-22 17:10:08.426455:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12760: 2021-12-22 17:10:09.071746:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12772: 2021-12-22 17:10:12.035887:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12778: 2021-12-22 17:10:12.459533:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12790: 2021-12-22 17:10:13.086318:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12802: 2021-12-22 17:10:13.714213:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
    Line 12814: 2021-12-22 17:10:14.381314:Thread-3  : loadImage.RECEIVED WEB DATA: 500, Internal Server Error, <raw data>
Reply
I have made some updates to this utility for my own purposes, but it may help others.
No guarantee of future updates, but PRs are welcome.
 
  • Ensure trailing slash for vscan dir to avoid scraping of subfolder names
  • Allow directory to be specified for VideoLibrary.Clean (Matrix+ only)
  • New download.interval setting and change some defaults to avoid rate limits (discussed earlier in this thread)

I have set the default download.interval to 1.5 seconds which works well for me with download.threads = 2 but YMMV.

https://github.com/hugepants/texturecache.py
Reply
@hugepants THANK YOU!

Tested with Kodi V19.3 (Libreelec 10.01)
Reply
(2021-12-26, 16:00)hugepants Wrote: I have made some updates to this utility for my own purposes, but it may help others.
No guarantee of future updates, but PRs are welcome.
 
  • Ensure trailing slash for vscan dir to avoid scraping of subfolder names
  • Allow directory to be specified for VideoLibrary.Clean (Matrix+ only)
  • New download.interval setting and change some defaults to avoid rate limits (discussed earlier in this thread)

I have set the default download.interval to 1.5 seconds which works well for me with download.threads = 2 but YMMV.

https://github.com/hugepants/texturecache.py

THANK YOU!
Reply
@palindrom You already thanked hugepants right after his own post, no need to do it a 2nd time with a useless quote. I'm sure he heard you the 1st time. Smile
Reply
This question may have already been answered here, but I can't find it.  Sorry if it's a duplicate.

I lost my back end MySQL server and had to rebuild it from scratch. Fortunately, I had a recent backup and I was able to restore.  I have four RPi4's running LibreElec Matrix. The primary is wired, but the other three are on WIFI. Once I got the database back the primary looked good.  All of the images showed, and I thought all was okay. However, that was not the case with the other three PI's.  I can see descriptions, but no images.  I've attempted to run this script multiple times before realizing that it is actually only updating the local texturescache db.  Looking at the current configuration, I see that the database setting is dbfile = ./Database/Textures13.db (or something like that).

What is the syntax to point the script to my sql database? 

Thank you.

Daryl
Reply
@rosede - How I have resolved re-syncing boxes is to get the primary box all squared up. Once that is working properly, blow away the thumbs folder on the other boxes and copy the thumbs dir from the primary box to the other boxes. Then run TC on the other boxes one at a time with 
python:
./texturecache.py c
Reply
(2021-09-22, 15:38)lpt2007 Wrote: I try to add missing poster with command:
texturecache.py c tvshows "'Allo 'Allo!"

and I get error:
Traceback (most recent call last):
  File "/usr/bin/texturecache.py", line 8663, in <module>
    main(sys.argv[1:])
  File "/usr/bin/texturecache.py", line 8353, in main
    if not checkConfig(argv[0]): sys.exit(2)
  File "/usr/bin/texturecache.py", line 7893, in checkConfig
    data = wcomms.sendJSON(REQUEST, "libPing", checkResult=False, useWebServer=True)
  File "/usr/bin/texturecache.py", line 2230, in sendJSON
    return self.sendWeb("POST", "/jsonrpc", id, request, {"Content-Type": "application/json"}, timeout=timeout)
  File "/usr/bin/texturecache.py", line 2177, in sendWeb
    raise httplib.HTTPException("Remote web host requires webserver.username/webserver.password properties")
httplib.HTTPException: Remote web host requires webserver.username/webserver.password properties

I am having the same issue
Anyone?
Reply
(2022-03-09, 20:23)tmacca Wrote: I am having the same issue

You're probably using the previous, not-Matrix-compatible version of TextureCache tool.
Download this add-on, it has a Matrix version onboard: https://github.com/klyco/script.database.cleaner
Reply
I could NOT find a Python3 version of the Texture Cache Maintenance Utility in the current "Video Database Cleaner Add-on" v3.0.0! There is also only the known Python2 version of texturecache.py included.

IMPORTANT: The current texturecache.py in version 2.5.4 only works correctly with Python <=2.7.8!

Python 2.7.8 fixes all "bugs" that occur under an installed Python3 and texturecache.py thus works without problems with Kodi 19.4.
Reply
Kodi version 19.3
Texturecache version = 2.5.4
 
This might be a lost cause, but this is the error message I'm getting when trying to run this on my Nvidia Shield via Samba on my Linux machine.

python:
$ ./texturecache.py s "Ragnarok"
FATAL: The task you wish to perform requires read/write file
       access to the Kodi SQLite3 Texture Cache database.

       The following SQLite3 database could not be opened:
       smb://192.168.1.128/internal/Android/data/org.xbmc.kodi/files/.kodi/userdata/Database/Textures13.db

       Check settings in properties file texturecache.cfg,
       or upgrade your Kodi client to use a more recent
       version that supports Textures JSON API.

The file are listed root/root in Thunar, but I can read and write through Thunar without issue without being root in Linux. I wonder why I don't have the same access via the commandline.

The enabled config file options are..

python:
userdata = smb://192.168.1.128/internal/Android/data/org.xbmc.kodi/files/.kodi/userdata/
dbfile = Database/Textures13.db
thumbnails = Thumbnails/

I've researched this error but haven't turned up anything useful yet. Posting here just to see if there is something I'm missing.

Thanks!
Reply
(2022-07-25, 15:31)akovia Wrote: This might be a lost cause, but this is the error message I'm getting when trying to run this on my Nvidia Shield via Samba on my Linux machine.

python:
$ ./texturecache.py s "Ragnarok"
FATAL: The task you wish to perform requires read/write file
       access to the Kodi SQLite3 Texture Cache database.

       The following SQLite3 database could not be opened:
       smb://192.168.1.128/internal/Android/data/org.xbmc.kodi/files/.kodi/userdata/Database/Textures13.db

       Check settings in properties file texturecache.cfg,
       or upgrade your Kodi client to use a more recent
       version that supports Textures JSON API.
Your path specification is wrong! Just comment out the paths in the texturecache.cfg with "#", you don't need that, because you are directly in the right path via RPC-Call ;-)

Everything back to default, then it will work:
Code:
#userdata = ~/.xbmc/userdata/
#dbfile = Database/Textures13.db
#thumbnails = Thumbnails/
Reply
Hi,

I have discovered a problem and wonder if there is some way that texturecache utility may be able to assist.

I use Radarr/Sonarr for automatic release downloads. I set the file directory and filename format to be the releasename(year)\releasename.year.extension.

The purpose of this, is that if a file is upgraded in quality. IE, from 720p to 2160p. The filename remains the same, and there is no requirement to remove/rescan that library item.

This presents a problem where the videosolution data, audio data, and so forth in the Kodi database remains as the OLD data.

The only way I have found to resolve this, is to remove the item and rescan it.

I wonder if there is some way I could achieve this with texturecache utility? Otherwise its a GUI task in the kodi interface each time.

Keep up the good work and thank you.
Reply
(2022-10-14, 15:16)yhs4260 Wrote: Hi,

I have discovered a problem and wonder if there is some way that texturecache utility may be able to assist.

I use Radarr/Sonarr for automatic release downloads. I set the file directory and filename format to be the releasename(year)\releasename.year.extension.

The purpose of this, is that if a file is upgraded in quality. IE, from 720p to 2160p. The filename remains the same, and there is no requirement to remove/rescan that library item.

This presents a problem where the videosolution data, audio data, and so forth in the Kodi database remains as the OLD data.

The only way I have found to resolve this, is to remove the item and rescan it.

I wonder if there is some way I could achieve this with texturecache utility? Otherwise its a GUI task in the kodi interface each time.

Keep up the good work and thank you.
This is not possible via the Texture Cache Maintenance Utility, as the MyVideosXXX.db must be changed here. You could include something like that in it, but that's not what the script is for.

I would do it manually via the "DB Browser for SQLite", or if it happens more often, you can also write a script with "SQLite".

In the DB Browser, you first look for the corresponding idFile in the "files" table and then you can adjust the entry for the resolution in the "streamdetails" table and you don't even have to start Kodi.

https://sqlitebrowser.org/
https://www.sqlite.org/

Image
Reply
  • 1
  • 192
  • 193
  • 194(current)
  • 195
  • 196
  • 197

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Texture Cache Maintenance utility17