• 1
  • 88
  • 89
  • 90(current)
  • 91
  • 92
  • 197
[RELEASE] Texture Cache Maintenance utility
Hi, is the raspberry pi limited to only 2 threads when using this script?
I've already set to using 5 connections in the config file yet it's still using only 2 threads.
Reply
No, it can use more. Presumably you're setting it incorrectly - confirm the number of threads with:
Code:
./texturecache.py config | grep download.threads
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
Hey all,

Does anyone have any suggestion for running TCMU from a Kodi addon in windows? I ask because in windows I mainly use Kodi as a launcher for games and emulators so it is not running all the time, plus there is no ssh so the only way to run it is by accessing the desktop. I've made a addon to launch a script which runs TCMU (so its easy to run while a big game downloads in Steam and I'm watching something) and the script works well outside of Kodi, though when launching the addon via kodi I get the error: 'fatal python error:py_initialize: unable to load the filesystem codec'. Screenshot. I think its trying to use Kodi's built in python - Ive tried setting the working directory and the PATH variable to the python install directory in the AHK script, to no avail, I always get the same error.

The addons default.py (it's a bit rough, I've reused other bits and pieces):
Code:
import xbmc, os, xbmcaddon, subprocess

addon = xbmcaddon.Addon()
script = '"c:\Program Files\AutoHotkey\AutoHotkeyU64.exe" "c:\Emulation\scripts\Ahk\kodi-cleanup.ahk"'
print(script)
subprocess.Popen(script, shell=True, close_fds=True)

The AHK script:
Code:
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance Force

SetWorkingDir, c:\Python33
Run, %comspec% /c c:\emulation\scripts\curl.exe -i -X POST -d "{\"jsonrpc\":\"2.0\"`,\"method\":\"GUI.ShowNotification\"`,\"params\":{\"title\":\"Texture Cache Maintenance\"`,\"message\":\"Starting\"`,\"image\":\"c:/emulation/artwork/cache-maintenance.png\"}`,\"id\":1}" -H "content-type: application/json;" http://localhost:9191/jsonrpc,,Hide

WinWait, Kodi ahk_class Kodi
Sleep, 5000

Run, %comspec% /c PYTHONPATH="C:\python33\DLLs;C:\python33\Lib;C:\python33\Lib\site-packages"
RunWait, c:\Python33\python.exe c:\Users\xbmc\AppData\Roaming\Kodi\texturecache.py u, c:\Users\xbmc\AppData\Roaming\Kodi ;, Hide

RunWait, %comspec% /c c:\Python33\python.exe c:\Users\xbmc\AppData\Roaming\Kodi\texturecache.py u, c:\Python33 ;, Hide
RunWait, %comspec% /c c:\Python33\python.exe c:\Users\xbmc\AppData\Roaming\Kodi\texturecache.py c, c:\Python33 ;, Hide
RunWait, %comspec% /c c:\Python33\python.exe c:\Users\xbmc\AppData\Roaming\Kodi\texturecache.py P, c:\Python33 ;, Hide
RunWait, %comspec% /c c:\Python33\python.exe c:\Users\xbmc\AppData\Roaming\Kodi\texturecache.py R, c:\Python33; , Hide

Run, %comspec% /c c:\emulation\scripts\curl.exe -i -X POST -d "{\"jsonrpc\":\"2.0\"`,\"method\":\"GUI.ShowNotification\"`,\"params\":{\"title\":\"Texture Cache Maintenance\"`,\"message\":\"Completed\"`,\"image\":\"c:/emulation/artwork/cache-maintenance.png\"}`,\"id\":1}" -H "content-type: application/json;" http://localhost:9191/jsonrpc,,Hide

I'm not adverse to doing everything in python, its just I'm not overly familiar with it and I've just reused bits of other stuff I already have for Kodi.
Reply
Not really sure, as I don't use Windows for Kodi. Have you looked at the Advanced Launcher addon?

By the way, you can send notifications using "texturecache.py notify title message [displaytime [image]]" (once you've got the python issue sorted, of course).
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
(2015-02-23, 10:31)teeedubb Wrote: Hey all,

Does anyone have any suggestion for running TCMU from a Kodi addon in windows?

You might want to have a look at something like py2exe and see if you can create a windows executable from the script.

scott s.
.
Reply
Hello all,

I have been having a few issues with a new Kodi device I installed with posters not showing up on most of my older movies (using a SQL database on my NAS). I found this utility today and did some poking around and found that the paths to my fanart and poster URL's are no longer valid:

OpenELEC:~ # ./texturecache.py C movies "Dr. No"

Need to cache: [ fanart ] for movie: Dr. No
Need to cache: [ poster ] for movie: Dr. No

Caching artwork: 0 items remaining of 2 (qs: 0, qm: 0), 2 errors, 0 threads active (00.53 downloads per second, ETA: 00:00:00)

The following items could not be downloaded:

[poster ] [Dr. No ] http://cf2.imgobject.com/t/p/original/h6...wgF1YU.jpg
[fanart ] [Dr. No ] http://cf2.imgobject.com/t/p/original/bp...QsFtDi.jpg


It looks like anything that is pointing to http://cf2.imgobject.com is not working on my new device (my main client is loading everything just fine and I assume that is because the artwork is already cached locally so it doesn't need to pull from the invalid URL?)

After a bit of google searching I found that if I change the URL prefix from http://cf2.imgobject.com to http://image.tmdb.org the image loads fine. In the example of the two above files, entering the following displays them in a browser:

http://image.tmdb.org/t/p/original/h6tnJ...wgF1YU.jpg
http://image.tmdb.org/t/p/original/bplDi...QsFtDi.jpg

My question is, since http://cf2.imgobject.com is no longer valid, is there a quick and easy way to change all entries in my database to http://image.tmdb.org/ ?

I am not sure where these pointers come from (textures##.db or mymovies##.db) and wanted to check before I make things worse (sorry not a DB guy at all). Maybe there is a way to change these using texturecache.py?

Thanks in advance for any help/guidance
Reply
Under phpmyadmin :
open xbmc -> xbmc_videoXX -> art
clic search (here another db but same interface) Image
and search and replace

Choose the url colonne and in the first box, tip the old link (http://cf2.imgobject.com) and in the second box, the new link (http://image.tmdb.org).
clic on "execute" (this will launch a simulation). If it's ok, go to the end of the results and clic accept.

I use the french version so i don't sur of the english name but you will certainly success ^^
Reply
Is it possible to extract video meta information (such as codec, aspect ratio, duration) from files with this utility? The setting in Kodi is Video -> File lists -> Extract video information from files. That would be great for getting the meta information faster on Raspberry Pi.
Reply
(2015-02-23, 21:56)Xtropy Wrote: My question is, since http://cf2.imgobject.com is no longer valid, is there a quick and easy way to change all entries in my database to http://image.tmdb.org/ ?

This is fairly easy to script with a small Python/JSON program. I've added such a program, fixart.py.

Install:
Code:
curl https://raw.githubusercontent.com/MilhouseVH/texturecache.py/master/tools/fixart.py -o fixart.py && chmod +x ./fixart.py

To use it:
Code:
./texturecache.py jd movies | ./fixart.py --from "http://cf2.imgobject.com" --to "http://image.tmdb.org" > changes.dat

and then apply the changes (assuming you're happy with the content of the changes.dat file):
Code:
cat changes.dat | ./texturecache.py set

It should also work for sets and tvshows, just change the media type on the jd option.

(2015-02-23, 21:56)Xtropy Wrote: I am not sure where these pointers come from (textures##.db or mymovies##.db) and wanted to check before I make things worse (sorry not a DB guy at all). Maybe there is a way to change these using texturecache.py?

MyMovies##.db.

This particular problem (remote artwork disappearing/moving) is why remote artwork becomes increasingly hazardous when adding additional clients in a MySQL configuration - you're much better off using local-only artwork (see mklocal.py) so that you can avoid this kind of thing.
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
(2014-10-29, 21:35)Milhouse Wrote: Version v1.8.2
  • Add: Profile support with new properties: profile.name, profile.password, profile.password.encrypted, profile.directory, profile.autoload and profile.enabled.

    Specify profile.directory relative to the profiles folder, although this property is only required if the directory is not using the same name as the profile.name. If direct file system access is required, eg. for Thumbnails or Database folders, the path to be used will be constructed from userdata/profiles/profile.directory.

    profile.autoload will control whether profiles are automatically loaded when required - the default value is yes. If set to no the script will exit with an error message if the currently loaded profile is not the required profile (if the required profile is already loaded the script will complete successfully).

    If you wish to temporarily disable profile support, for instance to determine the current profile when using status or stats options (which may otherwise load a new profile before collecting the status/stats), use @profile.enabled=no so that all profile loading behaviour is disabled. This may cause unpredictable results depending on the JSON-based option being used, however (no different to previous versions of the script).

    Specify yes for profile.password.encrypted if your profile.password is the hashed lock code from profiles.xml, otherwise provide a cleartext password and no (default) for profile.password.encrypted.

  • Fix: Use a sane default when userdata is not known. Fixes #24.

Finally got around to using your profile support. Worked great with @profile.name= Thanks for putting that together Milhouse Cool

Also got around to trying out sending the commands from my Mac, much easier than ssh'ing in every time to run the script. I created aliases in my zsh, so a simple tc1 or tc2 is all I need to run ./texturecache.py @section=pi1 and ./texturecache.py @section=pi2 Thanks again, great work.
Reply
[text cut, ignore this post]

lol, solution to my problem was mentioned in post *right* above mine.
Reply
(2015-02-24, 00:49)Polygon Man Wrote: Is it possible to extract video meta information (such as codec, aspect ratio, duration) from files with this utility? The setting in Kodi is Video -> File lists -> Extract video information from files. That would be great for getting the meta information faster on Raspberry Pi.

No, unfortunately it's a GUI thread that extracts the streamdetails information, and it's not possible to extract this information via JSON.
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
(2015-02-23, 11:11)Milhouse Wrote: Not really sure, as I don't use Windows for Kodi. Have you looked at the Advanced Launcher addon?

By the way, you can send notifications using "texturecache.py notify title message [displaytime [image]]" (once you've got the python issue sorted, of course).

(2015-02-23, 21:12)scott967 Wrote:
(2015-02-23, 10:31)teeedubb Wrote: Hey all,

Does anyone have any suggestion for running TCMU from a Kodi addon in windows?

You might want to have a look at something like py2exe and see if you can create a windows executable from the script.

scott s.
.

Thanks for the suggestions guys, I got it to wrk by setting the environment variable PYTHONHOME and PYTHONPATH in the ahk script, eg:

Code:
EnvSet, PYTHONHOME, C:\python33
EnvSet, PYTHONPATH, "C:\Python33\DLLs;C:\Python33\Lib;C:\Python33\Lib\site-packages"
Reply
3 questions:
1. where from does the lnc arg take the data? i enabled the "lastrunfile" in the config file but it doesnt change after running with c.
2. how can i remove the pvr module from c?
3. i know i had 3 question but i forgot the 3rd one, later...

thanks
Reply
1. It's only going to be updated when you execute lc, not c.
2. Disable the PVR functionality in Kodi. Or execute "c <class>" sequentially, for whatever classes you want to update.
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
  • 88
  • 89
  • 90(current)
  • 91
  • 92
  • 197

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