• 1
  • 117
  • 118
  • 119(current)
  • 120
  • 121
  • 197
[RELEASE] Texture Cache Maintenance utility
My .kodi directory is now up to 6.9GB. I'm guessing most of this is artwork for media that is no longer in my Kodi database.

Can texturecache remove all the artwork that is no longer has entries in the database? Sorry if this is a stupid question. I don't completely understand the internal workings of Kodi and how texturecache works with it.

If that's not possible, what is the best way to get rid of all this orphaned data that's taking up space?

Thanks
/ OSMC on Raspberry Pi 3 / Kodi 17 RC / FireTV Stick /
Reply
(2015-12-27, 08:35)leetwanker Wrote: Can texturecache remove all the artwork that is no longer has entries in the database?

Yes, and from following specific extract, from 1st post in this thread :-

Quote:[p, P] Prune texture cache by identifying (p) or removing (P) accumulated cruft such as image previews, previously deleted movies/tv shows/music whose artwork remains in the texture cache even after cleaning the database. Essentially, remove any cached file that is no longer associated with an entry in the media library and is therefore just wasting disk space.

So assuming you have texturecache installed, ssh into your Rpi from computer and then run following command.
(My basic understanding of simplest way to do what you want)

Code:
./texturecache.py P
RPi4, (LibreELEC 11.0) hdmi0 -> Philips 55PUS7304 4K TV, hdmi1 -> Onkyo TX-SR608 AV Receiver
Reply
Thanks. Not sure how I missed that. I read through all the options a few times. Maybe it was "cruft" that threw me off.

7 GB to 376 MB.
/ OSMC on Raspberry Pi 3 / Kodi 17 RC / FireTV Stick /
Reply
I'm currently getting an error ./texturecache.py p failed with return code 1 and error message Loading Albums...
Then it shows all my music info. What would cause this? I scanned the other day with no issues and can't recall changing anything to my system since.
Reply
(2015-12-28, 04:14)McButton Wrote: I'm currently getting an error ./texturecache.py p failed with return code 1 and error message Loading Albums...
Then it shows all my music info. What would cause this? I scanned the other day with no issues and can't recall changing anything to my system since.

Can you run:
Code:
./texturecache.py p @logfile=$HOME/tc.log
then upload "$HOME/tc.log" somewhere - you'll probably need to zip the log file as it may be quite large.

Without the complete log file I have no clue what is happening.
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
Hi Milhouse

I have an error when running "/storage/downloads/texturecache.py imdb | /storage/downloads/texturecache.py set" :

Code:
Traceback (most recent call last):
  File "/storage/downloads/texturecache.py", line 8413, in <module>
    main(sys.argv[1:])
  File "/storage/downloads/texturecache.py", line 8325, in main
    setDetails_batch(dryRun=dryRun)
  File "/storage/downloads/texturecache.py", line 6088, in setDetails_batch
    jdata = json.loads("".join(data))
  File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.0/Python
-2.7.3/.install_pkg/usr/lib/python2.7/json/__init__.py", line 326, in loads
  File "/home/stephan/projects/openelec-6.0/build.OpenELEC-RPi2.arm-6.0.0/Python
-2.7.3/.install_pkg/usr/lib/python2.7/json/decoder.py", line 369, in decode
ValueError: Extra data: line 9476 column 1 - line 12650 column 1 (char 167978 -
235662)

System is a RPI2 running OpenELEC 6.0

Thanks in advance for your help !
Reply
(2016-01-06, 16:36)Fredouye Wrote: I have an error when running "/storage/downloads/texturecache.py imdb | /storage/downloads/texturecache.py set" :

imdb can now be run for movies or tvshows.

By not specifying movies or tvshows it is being run for both which produces two sets of change details (one for movies, one for tvshows).

The "set" command isn't expecting this... it's only meant to consume one set of change details, so it chokes when it finds the second set.

Just add the movies or tvshows parameter. I should probably make the movies/tvshows parameter mandatory for imdb in a future release.
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
Thanks, it's working fine.
Reply
Hi, i've migrated from a pc running windows to a rpi running osmc.
I've exported my media lib, then turn kodi media library into mysql mode, then import my library.
Now, i'm running kodi on my RPI2, library is accessible but artworks are missing, so i've tryied to recache everything with your script, but something is going wrong as it is searching files localy is a path that doesn't exist anymore.

log extract :

Code:
2016-01-08 14:40:51.419179:Thread-2  : preparedl.JSON WEB REQUEST: [{"jsonrpc": "2.0", "params": {"path": "image://C%3a%5ckodi%5cxbmc_videodb_2016-01-02%5cmovies%5cBlue_Velvet_1986-fanart.jpg/"}, "method": "Files.PrepareDownload", "id": "preparedl"}]
2016-01-08 14:40:51.434203:Thread-2  : preparedl.RECEIVED WEB DATA: 200, OK, {"error":{"code":-32602,"data":{"details":null},"message":"Invalid params."},"id":"preparedl","jsonrpc":"2.0"}
2016-01-08 14:40:51.435165:Thread-2  : Retrying getDownloadURL(), 2 attempts remaining
2016-01-08 14:40:51.807178:Thread-1  : preparedl.JSON WEB REQUEST: [{"jsonrpc": "2.0", "params": {"path": "image://C%3a%5ckodi%5cxbmc_videodb_2016-01-02%5cmovies%5cBons_baisers_de_Russie_1963-fanart.jpg/"}, "method": "Files.PrepareDownload", "id": "preparedl"}]
2016-01-08 14:40:51.823285:Thread-1  : preparedl.RECEIVED WEB DATA: 200, OK, {"error":{"code":-32602,"data":{"details":null},"message":"Invalid params."},"id":"preparedl","jsonrpc":"2.0"}
2016-01-08 14:40:51.824067:Thread-1  : Retrying getDownloadURL(), 2 attempts remaining

What can i do to force artwork refresh for all movies/tvshows?
I've tryied the c and C option without any luck.

Thx.
Reply
First tou have to ser artwork to new locations using mklocal script. Then set these new locations to the database só than you can cache artwork.
Image Image
Reply
(2016-01-08, 16:09)lezioul Wrote: What can i do to force artwork refresh for all movies/tvshows?
I've tryied the c and C option without any luck.

Thx.

Your artwork is using a local Windows path, ie. C:\kodi\xbmc_videodb_2016-01-02\movies\Blue_Velvet_1986-fanart.jpg.

Presumably when you exported the library you opted to use a single file, with artwork written to a single Windows folder, which is now referenced by the NFO file that you created (and subsequently imported). The Pi is now trying to access the Windows path, which is never going to work.

You should have exported your library to separate files, writing the artwork and NFO files alongside your media files. Then scanned/scraped in the files you created, using either smb:// or nfs:// as a source.
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
@lezioul if you have your artwork alongside your media files, then maybe using mklocal.py could recover the situation for you, it depends on how your media files are setup and what sources you are using (are the movies accessible to the Pi, or is it trying to access a Windows path too?). Link to mklocal.py at the bottom of the first post.
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
Thx for you help.
I've tryied something else : updating videodb (column 'url' of table 'art' set to null when containg '%xbmc_videodb_2016-01-02%') but it didn't change anything... now there is nothing to update when i use option C ou c.

I'll have a look at mklocal but i have just another question : is it possible to automate the process of downloading poster/fanart with your tool in the same way as it's done manually when i press "i" on the keyboard?

edit : i've found a workaround for my problem :
1. get a backup of my export
2. copy all fanart/poster to the video directory
3. update art table from videodb and replace url column with a correct value (smb:// relative path instead of C:\kodi.. )
Reply
(2016-01-09, 11:00)lezioul Wrote: I'll have a look at mklocal but i have just another question : is it possible to automate the process of downloading poster/fanart with your tool in the same way as it's done manually when i press "i" on the keyboard?

"i" doesn't download any artwork, it does however allow you to associate new artwork (either local or remote).

If you want to find new artwork (with the option of downloading) you can look at Artwork Downloader.

If you want to automatically download already associated remote artwork, or associate already downloaded local artwork (which may previously have been remote), then use mklocal.py.
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
Ok, thx Smile
Reply
  • 1
  • 117
  • 118
  • 119(current)
  • 120
  • 121
  • 197

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