[RELEASE] Texture Cache Maintenance utility
(2013-11-06, 23:06)ctawn Wrote: Is it possible to use this on an ATV2 (running XBMC Frodo)

Possible, yes, though it's often a challenge to find the right sqlite package - there were some notes on how to accomplish this earlier in the thread, I think the OP has a link in the installation section.

With the introduction of the Textures JSON API (Gotham only) it will be possible to make the dependency on sqlite3 entirely optional, so as long as you're running a recent master build you should be able to run the texturecache.py script without sqlite3 being installed. The next version of texturecache.py will support this optionality, v1.0.4 will fail to run if sqlite3 is not installed.

(2013-11-06, 23:06)ctawn Wrote: to remove all cached images generated by video add-ons only, and nothing else?

I did read it will be required to install python 2.73, and I am fine with that. But before delving further into this, I'd like to know if it is possible and smooth enough. Specific examples would be very helpful. TIA.

Sure, if you are able to identify the matching urls for the video addons, as there is nothing in the texture cache database that associates a cached image with the script, addon or library that created (or "owns") it, other than possibly some unique location or web address.

Here's a few BBC iPlayer cached images that I found using the "s" (search) function - note that several columns have been removed for clarity, those shown are id, cachedurl, lasthashcheck and url:
Code:
# ./texturecache.py s iplayer
000002|b/b6a8e02e.png|2013-11-06 05:04:54|/storage/.xbmc/addons/plugin.video.iplayer/icon.png
018704|c/cdeff6b3.png|2013-11-06 22:16:38|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/popular.png
018705|3/3986054e.png|2013-11-06 22:16:40|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/highlights.png
018706|5/5d70a9db.png|2013-11-06 22:16:40|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/tv.png
018707|e/e3bdcbd6.png|2013-11-06 22:16:27|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/categories.png
018708|3/323ff724.png|2013-11-06 22:16:37|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/search.png
018709|0/034b523c.jpg|2013-11-06 22:16:36|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/bbc_one.png
018710|3/360222ba.jpg|2013-11-06 22:16:40|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/bbc_four.png
018711|d/d3529073.jpg|2013-11-06 22:16:40|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/bbc_three.png
018712|b/b9346b1f.jpg|2013-11-06 22:16:44|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/cbbc.png
018713|4/4ba1eeea.jpg|2013-11-06 22:16:44|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/cbeebies.png
018714|2/2f9ffca4.jpg|2013-11-06 22:16:44|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/bbc_news24.png
018715|2/2c9085cf.jpg|2013-11-06 22:16:44|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/bbc_parliament.png
018716|e/e02302b6.jpg|2013-11-06 22:16:34|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/bbc_two.png
018717|a/a59ccda5.jpg|2013-11-06 22:16:44|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/bbc_hd.png
018718|c/ce03df8c.jpg|2013-11-06 22:16:44|/storage/.xbmc/addons/plugin.video.iplayer/resources/media/bbc_alba.png
031335|9/926dc24d.jpg|                   |http://www.bbc.co.uk/iplayer/images/episode/p01crz3s_512_288.jpg
031336|a/a3783f88.jpg|                   |http://www.bbc.co.uk/iplayer/images/episode/b03gf54z_512_288.jpg
031337|5/51a719b6.jpg|                   |http://www.bbc.co.uk/iplayer/images/episode/b03gf5k7_512_288.jpg
031338|0/029f2b1a.jpg|                   |http://www.bbc.co.uk/iplayer/images/episode/b03gmh7k_512_288.jpg
031339|7/79057c60.jpg|                   |http://www.bbc.co.uk/iplayer/images/episode/b03gf5xf_512_288.jpg
Matching row ids: 2 18704 18705 18706 18707 18708 18709 18710 18711 18712 18713 18714 18715 18716 18717 18718 31335 31336 31337 31338 31339

The local artwork you probably don't want to delete, but the remote artwork you do, so search using a more complete URL that identifies only the remote artwork:
Code:
./texturecache.py s http://www.bbc.co.uk/iplayer
then delete the matching ids with:
Code:
./texturecache.py d 31335 31336 31337 31338 31339

You can script this:
Code:
IDS=$(./texturecache.py s "http://www.bbc.co.uk/iplayer" 2>&1 1>/dev/null | grep "Matching row ids" | cut -b19-)
[ -n "$IDS" ] && ./texturecache.py d $IDS

then run it as often as you like, maybe under cron.

You could also return just the iplayer artwork which hasn't been hashed (possibly indicative of it being temporary/transient), eg.
Code:
./texturecache.py x 'where lasthashcheck = "" and url like "%iplayer%"'
then delete the returned id's as you would when using the "s" option, however the above query isn't guaranteed to work right now with the new Textures JSON API (fingers crossed an update might change that).

Should you delete any addon artwork that you meant to keep, just re-cache it (./texturecache.py c addons), or leave it to be re-cached automatically as you browse the GUI.

Is that specific enough for you? Wink
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


Messages In This Thread
RE: [RELEASE] Texture Cache Maintenance utility - by Milhouse - 2013-11-07, 00:49
Crash on Gotham on OS X - by desepticon - 2014-05-29, 17:57
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 utility17