• 1
  • 122
  • 123
  • 124(current)
  • 125
  • 126
  • 197
[RELEASE] Texture Cache Maintenance utility
(2016-02-02, 13:14)lstar337 Wrote: I gave it a go, but I get an addon error. Looking in the log it says this:

Ah right, you don't want to execute this script in the context of the Kodi process.

Here's a fix... http://sprunge.us/eLXN

Put this alongside the texturecache.py script, call it shell.py and give it execute permissions - on Linux:
Code:
wget http://sprunge.us/eLXN -O ~/.kodi/userdata/shell.py && chmod +x ~/.kodi/userdata/shell.py

Now your Runscript() call needs to be (note this assumes the texturecache.py script is alongside the shell.py script, otherwise specify the full path to texturecache.py - don't use special://whatever):
Code:
RunScript(special://profile/shell.py,./texturecache.py,c)

For instance to map this to a remote control button:
Code:
<red>XBMC.RunScript(special://profile/shell.py,./texturecache.py,c)</red>

As a bonus you'll get notifications on start and finish, and you won't be able to run multiple instances (which wouldn't be good).
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
(2016-02-02, 16:10)Milhouse Wrote:
(2016-02-02, 13:14)lstar337 Wrote: I gave it a go, but I get an addon error. Looking in the log it says this:

Ah right, you don't want to execute this script in the context of the Kodi process.

Here's a fix... http://sprunge.us/eLXN

Put this alongside the texturecache.py script, call it shell.py and give it execute permissions - on Linux:
Code:
wget http://sprunge.us/eLXN -O ~/.kodi/userdata/shell.py && chmod +x ~/.kodi/userdata/shell.py

Now your Runscript() call needs to be (note this assumes the texturecache.py script is alongside the shell.py script, otherwise specify the full path to texturecache.py - don't use special://whatever):
Code:
RunScript(special://profile/shell.py,./texturecache.py,c)

For instance to map this to a remote control button:
Code:
<red>XBMC.RunScript(special://profile/shell.py,./texturecache.py,c)</red>

As a bonus you'll get notifications on start and finish, and you won't be able to run multiple instances (which wouldn't be good).
Excellent, that seems to work a treat.

Now if I want a button to update the imdb ratings etc. then this:
Code:
RunScript(special://profile/shell.py,./texturecache.py, imdb movies |special://profile/texturecache.py set)
Should work?
Reply
(2016-02-02, 18:20)lstar337 Wrote: Now if I want a button to update the imdb ratings etc. then this:
Code:
RunScript(special://profile/shell.py,./texturecache.py, imdb movies |special://profile/texturecache.py set)
Should work?

No, you'll need to write a simple script, /storage/.kodi/userdata/imdb.sh, that encapsulates all that pipeline activity:
Code:
#!/bin/bash
/storage/.kodi/userdata/texturecache.py imdb movies | /storage/.kodi/userdata/texturecache.py set

don't forget to give it execute permission:
Code:
chmod +x /storage/.kodi/userdata/imdb.sh

then call imdb.sh via shell.py:
Code:
RunScript(special://profile/shell.py,./imdb.sh)

There's only so much you can do with RunScript() - it's not a general purpose command line substitute.
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

thanks for this useful script.

I have an "issue" regarding wallpapers (I'm using Amber skin, I don't know if that matters) : I use customs wallpapers for each menu item (animation, sports, tv shows, etc.).

Running "texturecache.py P" produces this :

Quote:003307|6/6c42a84f.jpg|0720|1280|0004|2016-02-03 04:29:44|2016-02-02 23:31:02|/home/osmc/wallpapers/Courts.png
003309|1/1047037a.jpg|0000|0000|0004|2016-02-03 04:29:44|2016-02-02 23:31:03|/home/osmc/wallpapers/Divers.jpg
003303|4/4df192bb.jpg|0000|0000|0002|2016-02-02 22:30:54|2016-02-02 23:30:48|/home/osmc/wallpapers/Documentaires.jpg
003304|6/64896cef.jpg|0720|1280|0001|2016-02-02 22:30:56|2016-02-02 23:30:56|/home/osmc/wallpapers/Films.jpg
003302|9/92e08f78.jpg|0000|0000|0003|2016-02-02 22:30:54|2016-02-02 23:30:48|/home/osmc/wallpapers/Frozen.jpg
003310|9/93b2247a.jpg|0000|0000|0001|2016-02-02 22:51:31|2016-02-02 23:51:31|/home/osmc/wallpapers/Kodi.jpg
003306|2/2d8c63ff.jpg|0000|0000|0005|2016-02-03 04:29:44|2016-02-02 23:31:00|/home/osmc/wallpapers/Series.jpg
003305|6/6dbbe492.jpg|0000|0000|0001|2016-02-02 22:30:57|2016-02-02 23:30:57|/home/osmc/wallpapers/Sport.jpg

As a result, when browsing into custom menu items, I get a small lag (before, I guess, the wallpaper is cached again).
Running "texturecache.py c" does not correct this issue.

Is there any way to "exclude" my wallpapers from prune, or is there a way to re-cache them ?

Many thanks in advance.
Reply
(2016-02-03, 23:14)Fredouye Wrote: Is there any way to "exclude" my wallpapers from prune

If you add to texturecache.cfg:
Code:
prune.retain.types = ^/home/osmc/wallpapers

you should find your wallpapers are retained.

(2016-02-03, 23:14)Fredouye Wrote: or is there a way to re-cache them ?

No, because they're not referenced by the media library.
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 works as expected !
Kodi 18.1 running on
- Nvidia Shield 2017
- Beelink GT1 Ultimate (S912 / 3Gb RAM) @ CoreELEC 9.0.1
- Mini M8S II (S905X / 2 Gb RAM) @ CoreELEC 9.0.1
Reply
If Kodi is showing movie cover art, but the folder itself actually has new art...but when I reload or remove/update in Kodi, it goes to the 1st cover...

./texturecache.py C <--- is this the correct command? I tried and it seemed to do nothing when it was done. Just making sure. Seemed to take a few hours, so I'm redoing it now.

Thanks!
Reply
(2016-02-04, 19:24)McButton Wrote: ./texturecache.py C <--- is this the correct command? I tried and it seemed to do nothing when it was done. Just making sure. Seemed to take a few hours, so I'm redoing it now.

Thanks!

Yes, but running it like that is going to re-cache *everything* - you normally only want to re-cache one item eg. "texturecache.py C movies avatar".

Or if you know the name of the artwork you can search for it in the cache (s <name>) then delete the specific row from the cache (d #) - there's an example of this usage in 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
(2016-02-04, 19:24)McButton Wrote: If Kodi is showing movie cover art, but the folder itself actually has new art...but when I reload or remove/update in Kodi, it goes to the 1st cover...

If Kodi is using artwork you think it shouldn't, you'll need to discuss that in the appropriate scanner support thread. No amount of re-caching will get Kodi to load artwork it knows nothing about, so if Kodi is using the "wrong" artwork you need to fix that first.
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
No. Example:
I changed artwork. It was poster.jpg of a flag. I change it to poster.jpg of a car. Kodi has it as the flag. I delete the movie and rescan. Still flag, via cache, but the flag no longer exists in a physical file as it was overwritten by the car. I kinda wanted to do "everything" anyway. I changed a lot of art recently. I may just crush the whole DB if it doesn't grab them. I pretty much rescraped my whole collection :\

Was just testing this to check a few things, however.

Thanks much!
------------------------------
Tested the single video...works great!
Aaaand, so does the whole thing. "C"

No need to reload my whole system. Win!
Reply
When changing artwork, you might also want to try:
Code:
texturecache.py C movies @cache.refresh=0
This will only re-cache artwork where the LAN image has been modified since midnight of the current day. @cache.refresh=1 would be midnight of the previous day. Etc.

This version is "safe" to run on a regular basis - when no artwork has been modified on your LAN during the @cache.refresh period then nothing will be re-cached.
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
And, lastly...is there a command to find duplicate episodes? Or, does duplicate cover the whole db? Seems like it just returns Movies.
Reply
Hi Milhouse,
Thanks so much for this script -- it's been essential in keeping Kodi small on my limited-storage FireTV v1. I do have one problem I hope you can help with however.

I mistakenly did a "texturecache.py c movies", which pre-cached a bunch of artwork my skins normally don't use, and used up hundreds MB of storage. Bascically lots of clearart, logos, banners, etc.

After searching the docs, I tried the following to remove the unnecesarily cached artwork.

First setting the require artwork in texturecache.cfg:
Code:
cache.artwork = poster, fanart, landscape, thumb, tvshow.poster, tvshow.fanart, tvshow.landscape, season.poster

Then running "texturecache.py C movies" in hopes it removes non-required artwork (i.e. not in cache.artwork).

Unfortunately this doesn't work, and the non-required artwork seems to be ignored for both removal and caching. What do you think is the best way of doing what I need?

As an aside, I've seen the "nc" function, which shows required artwork that is not cached. I wonder if we could have a converse function like "oc" (e.g. over-cached), which shows non-required artwork that is cached. Or perhaps even a sort of modified "C" function that doesn't ignore some artwork removal?

Thanks!
Reply
(2016-02-05, 01:08)McButton Wrote: And, lastly...is there a command to find duplicate episodes? Or, does duplicate cover the whole db? Seems like it just returns Movies.

No, "duplicates" is just for movies - it uses imdbnumber to determine a duplicate.

Tvshows don't have imdbnumbers, and I don't think the media library database supports multiple paths for the same tvshow/season/episode so I'm not sure how it would be possible to accurately determine that some random file path is a duplicate of an episode. If you've got any ideas let me know.
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
(2016-02-05, 01:26)guido1138 Wrote: Unfortunately this doesn't work, and the non-required artwork seems to be ignored for both removal and caching. What do you think is the best way of doing what I need?

Have a look at "purge" (and "purgetest" for testing) to remove artwork en mass. Give it the partial path for the cached artwork and it will remove them, eg.
Code:
texturecache.py purgetest all %clearart.png %logo.png %banner.jpg
substitute purge for purgetest to perform the actual deletion once you're happy with what it matches.

(2016-02-05, 01:26)guido1138 Wrote: As an aside, I've seen the "nc" function, which shows required artwork that is not cached. I wonder if we could have a converse function like "oc" (e.g. over-cached), which shows non-required artwork that is cached. Or perhaps even a sort of modified "C" function that doesn't ignore some artwork removal?

Thanks!

What's over-cached for you is not over-cached for someone else - how to tell?
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
  • 1
  • 122
  • 123
  • 124(current)
  • 125
  • 126
  • 197

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