• 1
  • 184
  • 185
  • 186(current)
  • 187
  • 188
  • 197
[RELEASE] Texture Cache Maintenance utility
(2020-03-30, 01:39)Milhouse Wrote: Run it as two commands, one command per line.

@Milhouse Thanks again for your kind help and much appreciated for someone don't know Python... Output of the commands as below. 

shell:
osmc@MBRVero4Kplus:~$ IDS=$(./texturecache.py x "where lastusetime <= '2020-03-10'" 2>&1 1>/dev/null | sed "s/.*: //")
osmc@MBRVero4Kplus:~$ [ -n "$IDS" ] && ./texturecache.py d $IDS
 is not valid
osmc@MBRVero4Kplus:~$
Reply
Oops, sorry! I pasted the command I used for testing, you're using a different date.

What follows is the command you need. Run it as before, two commands, one command per line:
text:

IDS=$(./texturecache.py x "where lastusetime <= '2019-03-05'" 2>&1 1>/dev/null | sed "s/.*: //")
[ -n "$IDS" ] && ./texturecache.py d $IDS

If that doesn't work, take a look at the value of IDS with:
text:

echo "$IDS"
as it should be multiple space delimited numbers.

It's also possible there's a command line limit on the length of the command line - if that's the case then we'll need to be a little more creative...
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
(2020-03-30, 02:28)Milhouse Wrote: Oops, sorry! I pasted the command I used for testing, you're using a different date.

What follows is the command you need. Run it as before, two commands, one command per line:
text:

IDS=$(./texturecache.py x "where lastusetime <= '2019-03-05'" 2>&1 1>/dev/null | sed "s/.*: //")
[ -n "$IDS" ] && ./texturecache.py d $IDS

If that doesn't work, take a look at the value of IDS with:
text:

echo "$IDS"
as it should be multiple space delimited numbers.

It's also possible there's a command line limit on the length of the command line - if that's the case then we'll need to be a little more creative...
Thanks.
Reply
Hi,

I'm trying to run:

./texturecache.py P

But I'm getting an exception:

Traceback (most recent call last):
  File "./texturecache.py", line 8660, in <module>
    main(sys.argv[1:])
  File "./texturecache.py", line 8487, in main
    pruneCache(remove_nonlibrary_artwork=True)
  File "./texturecache.py", line 6577, in pruneCache
    (libraryFiles, mediaFiles) = getAllFiles(keyFunction=getKeyFromFilename)
  File "./texturecache.py", line 6886, in getAllFiles
    episodedata = jcomms.getDataProxy("episodes", REQUEST, uniquecast=UCAST)
  File "./texturecache.py", line 3257, in getDataProxy
    data = self.chunkedLoad(mediatype, request, trim_cast_thumbs, idname=idname, silent=silent, uniquecast=uniquecast)
  File "./texturecache.py", line 3296, in chunkedLoad
    data = self.sendJSON(request, idname)
  File "./texturecache.py", line 2298, in sendJSON
    for m in self.parseResponse(udata):
  File "./texturecache.py", line 2394, in parseResponse
    idx = _w(data, 0).end()
TypeError: cannot use a string pattern on a bytes-like object

Log: tc.log.zip
Reply
@Tomtefan Are you using SQLite for your video library? Would it be possible to upload your current MyVideos database somewhere?

It's having difficulty parsing the Season 3 episode data for the Homeland tv show, does it crash when running texturecache.py jd tvshows Homeland?
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
(2020-04-05, 20:13)Milhouse Wrote: texturecache.py jd tvshows Homeland

Yes I'm using sqlite and yes it crashes when I run that command.

I'll PM you a link to the db.

edit: It seems PM doesn't work
Reply
(2020-04-06, 19:23)Tomtefan Wrote: edit: It seems PM doesn't work

You should have PM rights now - please try again!
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
(2020-04-07, 01:41)Milhouse Wrote:
(2020-04-06, 19:23)Tomtefan Wrote: edit: It seems PM doesn't work

You should have PM rights now - please try again! 

You're right, I've sent the link.
Reply
Hi @Milhouse i don't know if i can ask to you and if your script can do somethings similar but i try anyway:

Can you script manage the already "Watched" database of kodi or the "Partial" watched ?? On currently kodi version it's possible to Reset the timing to resume a partial watched video (apparently it's a feature add on kodi 18.x)....... but how it's stored this database ? How it's works ? It's a database different for every device ?
...only on your "little world" can you lay down the law...
Reply
(2020-04-10, 21:05)DjDiabolik Wrote: Hi @Milhouse i don't know if i can ask to you and if your script can do somethings similar but i try anyway:

Can you script manage the already "Watched" database of kodi or the "Partial" watched ?? On currently kodi version it's possible to Reset the timing to resume a partial watched video (apparently it's a feature add on kodi 18.x)....... but how it's stored this database ? How it's works ? It's a database different for every device ?

Yes you can backup and restore watched state.

To backup:
text:

texturecache watched movies backup /tmp/movies.dat
texturecache watched tvshows backup /tmp/tvshows.dat

You can also specify the name of a media item to only backup that item (or matching items), eg:

text:

texturecache watched movies backup /tmp/movies.dat zombieland
to only backup the watched state of movies that include "zombieland" in the title.

And to restore all items in the specified file:
text:

texturecache watched movies restore /tmp/movies.dat
texturecache watched tvshows restore /tmp/tvshows.dat
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
(2020-04-08, 16:41)Tomtefan Wrote: You're right, I've sent the link.

Thanks I've downloaded your MyVideos116.db, I'll take a look at it over the weekend.
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
(2020-04-11, 01:00)Milhouse Wrote:
(2020-04-10, 21:05)DjDiabolik Wrote: Hi @Milhouse i don't know if i can ask to you and if your script can do somethings similar but i try anyway:

Can you script manage the already "Watched" database of kodi or the "Partial" watched ?? On currently kodi version it's possible to Reset the timing to resume a partial watched video (apparently it's a feature add on kodi 18.x)....... but how it's stored this database ? How it's works ? It's a database different for every device ?

Yes you can backup and restore watched state.

To backup:
text:

texturecache watched movies backup /tmp/movies.dat
texturecache watched tvshows backup /tmp/tvshows.dat

You can also specify the name of a media item to only backup that item (or matching items), eg:

text:

texturecache watched movies backup /tmp/movies.dat zombieland
to only backup the watched state of movies that include "zombieland" in the title.

And to restore all items in the specified file:
text:

texturecache watched movies backup /tmp/movies.dat
texturecache watched tvshows backup /tmp/tvshows.dat
 
I don't understand.. it's same command for backup and restore ?

Otherwise my question it's.... and the watched database it's different for every device attach, in my case, on my raspberry ?
For example... i have the same files on two different pen drive.... i have:
\A.avi
\B.avi
\C.avi
etc etc.
I watched to end from pendrive_1 \A.avi (example first episode of a tvseries). Remove pendrive_1 and attach to my raspberry the pendrive_2. How i already say the pendrive contain the same exact files....... i see the A.avi it's not mark as watched.
At this point I believe the database is different for each possible device...... or not ?

Another question it's.... usually i use "Videos" section of Estuary to watch video from my pendrive... all files it's categorized as "movies" ?

I know it's not all question related to this script but it's all concatenad question Smile
...only on your "little world" can you lay down the law...
Reply
(2020-04-11, 01:46)DjDiabolik Wrote: I don't understand.. it's same command for backup and restore ?

Feck, sorry - cut & paste error. Dammit! Smile

Original post updated.

(2020-04-11, 01:46)DjDiabolik Wrote: Otherwise my question it's.... and the watched database it's different for every device attach, in my case, on my raspberry ?
For example... i have the same files on two different pen drive.... i have:
\A.avi
\B.avi
\C.avi
etc etc.
I watched to end from pendrive_1 \A.avi (example first episode of a tvseries). Remove pendrive_1 and attach to my raspberry the pendrive_2. How i already say the pendrive contain the same exact files....... i see the A.avi it's not mark as watched.
At this point I believe the database is different for each possible device...... or not ?

The texturecache.py script is backing up the watched status from your media library (ie. videos you have previously scraped). If however you're watching videos via Files then this script is not going to work for you.

Assuming you are using a media library, then when restoring statuses the script matches on the name and year of the movie, or the show name/season#/episode# of the tvshow, so when restoring watched statuses to a second or third client it doesn't matter where the actual video files reside only that they have the same name etc.

(2020-04-11, 01:46)DjDiabolik Wrote: Another question it's.... usually i use "Videos" section of Estuary to watch video from my pendrive... all files it's categorized as "movies" ?

Yeah... so you're most likely *not* using a media library in which case this script is not going to be of any use to you. Sorry.
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
I am using texturecache.py v2.5.2 on a libreelec x64 installation which runs from a usb stick (sandisk ultrafit usb3.1). I know the version is not the latest one, but this is the one that comes with libreelec 9.2.2 today.
I do not use a library on that system because I use kodi as a player for my dlna server, so I just use texturecache.py to clean up the cache from stored thumbnails. 99.9% of this cache comes from content which updates very frequently, e.g. the thumbnails of youtube videos and live streams, the thumbnails of twitch channels (although I have set it them to refresh every 3 hours which is the maximum value) and the thumbnails of webcams from places around the world.

Every Saturday, I clean up that cache and it takes me ~30 minutes for ~100MB of files, all of them at below 100kb! That is insanely slow even for a usb drive. Given the fact that I do not use a library, wouldn't it be better to just delete the entire thumbnails folder and textures.db and have kodi rebuild them the next time each addon needs them?
Reply
(2020-04-11, 19:21)jim_p Wrote: Every Saturday, I clean up that cache and it takes me ~30 minutes for ~100MB of files, all of them at below 100kb! That is insanely slow even for a usb drive. Given the fact that I do not use a library, wouldn't it be better to just delete the entire thumbnails folder and textures.db and have kodi rebuild them the next time each addon needs them?

Which command are you using, is it texturecache.py P? I know you said you weren't using a library but are you running texturecache vclean? Can you check the kodi.log as the latter often tries to connect remote web sites which incurs a considerable delay when cleaning the library. If you're not using vclean then I'm not sure what else would result in such a long delay, maybe the kodi log has some clues.

But to answer your question - if you're not using a library then shutting down kodi then yes, deleting Textures13.db and the Thumbnails folder is likely the quickest and most reliable solution to clear out the textures cache.
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
  • 184
  • 185
  • 186(current)
  • 187
  • 188
  • 197

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