[RELEASE] Texture Cache Maintenance utility - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116) +--- Thread: [RELEASE] Texture Cache Maintenance utility (/showthread.php?tid=158373) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
RE: [RELEASE] Texture Cache Maintenance utility - marhutchy - 2015-10-22 @Milhouse this is my config file. I added some values for testing sake, don't know what values should go there. Code: userdata = ~/.xbmc/userdata/ Can you give some examples of the Code: extrajson.* Thanks RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2015-10-22 Here's a few examples: Code: extrajson.songs = file, artist, album, duration Any valid field (Kodi JSON RPC API) should work, and the relevant fields will be output on the "Jd" or "J" options (eg. "Jd songs" will include file, artist, album and duration in addition to the basic fields output when using "jd" or "j"). RE: [RELEASE] Texture Cache Maintenance utility - guido1138 - 2015-10-25 @Milhouse, Thank you so much for this invaluable script. I run it from Windows 7 to talk to my AFTVv1 running Kodi 15.2, and regularly use the 'p' and 'P' options to control usage of the limited space on my FireTV. Recently, I tried using the 'r' and 'R' options but receive the following errors (yes, different errors running twice in succession): Code: C:\> c:\Python27\python.exe texturecache.py r As I mentioned, I can successfully run using the 'p' or 'P' options, and my config file is simple: Code: userdata = /sdcard/Android/data/org.xbmc.kodi/files/.kodi/userdata/ I'd appreciate any suggestion you might have about the problem, and forgive me if there's an obvious mistake here. Many thanks and take care! RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2015-10-25 As per the error message, the option requires read/write access to the Textures13.db file and Thumbnails folder, ie. direct file system access. The options "f", "F", "r", "R", "S", "X", "Xd" all require direct filesystem access as there is currently no JSON functionality available for the actions these options perform (ie. deleting files from the Thumbnails folder when there is no matching entry in Textures13.db, and retrieving file size/date information of files from the Thumbnails folder). There are two solutions - run the texturecache.py script directly on the Kodi client, or mount the userdata folder of the Kodi client on the PC that is running the script. Note that specifying the Android userdata location in your texturecache config when running the script on a PC is not going to achieve anything as the location you have configured is not accessible to the PC. You need to mount the Kodi client userdata partition on the PC and then configure the userdata mount point on the PC as the userdata path, allowing the script to read/write data within the Kodi client userdata folder. However since you're using Android for the Kodi client and Windows to run the script, I suspect both solutions will be unavailable to you as I don't think you can run the script on an unrooted Android box, and it's unlikely you can mount the Android userdata folder on Windows (the userdata folder would have to be shared over SMB by Android). RE: [RELEASE] Texture Cache Maintenance utility - guido1138 - 2015-10-25 Thank you so much for the detailed explanation. I admit I had assumed the path was being evaluated in the context of the JSON server/Kodi client, and not the python script, or that file access was being done via the web server. I can see now using the script fully remotely can be more of a challenge. In any case, I'm more than happy to be able to use the 'p' and 'P' options remotely, so my thanks to you for that! Also, you got me curious so I was looking at the JSON APi, and noticed the Files.GetDirectory method and friends, which seem to support listing files, modification times and sizes, but no deletion as you say. So perhaps the 'r' option might possible but not the 'R' one at this time? Hopefully the API will be extended in future... Thanks again for such a helpful utility. RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2015-10-25 Unfortunately for security reasons, the Files.GetDirectory method will only return details of directories (and files) that are within your sources, so it's not currently possible to use this method to access the contents of the clients userdata folder. You can see this behaviour with the call "texturecache.py rdirectory special://masterprofile" which tries to recursively list the contents of the master profile directory (ie. .kodi/userdata), but it will fail. Now add "special://masterprofile/" to sources.xml, restart Kodi and try the rdirectory call again, and all files will be successfully retrieved. RE: [RELEASE] Texture Cache Maintenance utility - Gizmo81 - 2015-11-03 Hi, I got yesterday a new FireTV where I installed Kodi in addition to my RasPi2 with OpenELEC. For this I moved my local library via Export/Import from RasPi2 to my NAS where I setup a mySQL server. Now I have many missing artworks/covers etc. on FireTV, on RasPi2 everything is fine. If I rescrape a folder on RasPi2 then FireTV also gets the pictures, but I don't want to rescrape whole database. Did I understand right from flying through this thread, that if I install python and this tool on my pc, activate webserver on FireTV and running this line on PC: Code: ./texturecache.py @xbmc.host=192.168.1.34 c movies Thanks Giz RE: [RELEASE] Texture Cache Maintenance utility - redglory - 2015-11-03 If you've already set artwork for your media library than yupp, you can cache it like so. RE: [RELEASE] Texture Cache Maintenance utility - Gizmo81 - 2015-11-03 Yes I've already the artwork available from old scrap on RasPi2. RE: [RELEASE] Texture Cache Maintenance utility - Orbi - 2015-11-03 Hi, first a big thanks to Milhouse for developing and maintaining this great utlity. I cached my posters and fanart using the "c" option, but my discart, clearart are not being cached. I have tried looking for the answer in this thread, but I became none the wiser of it. My movies are organised into individual folders. Here are the names of the files that do not want to be cached:
What command or options should I be using? RE: [RELEASE] Texture Cache Maintenance utility - Gizmo81 - 2015-11-03 Hi again, found out my problem, I checked art table in mysql server. All the not new scraped movies in library are pointing to a path where export file was written. The new scraped movies and tv shows pointing to online links. Is there a command to rescrape/update all movies without doing one by one or removing them from library? RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2015-11-03 (2015-11-03, 21:23)Gizmo81 Wrote: Hi again, How did you migrate from your local RPi2 SQLite library to your centralised RPi2/FireTV library on MySQL if you didn't re-scrape your exported library? Assuming you exported your artwork too, then both devices should now be using this local artwork. Any artwork which was missing in the RPi2 at the time of the export may now be being sourced remotely from the internet. By the way, if you want to view the artwork urls associated with a movie there's no need to poke around in SQL: Code: texturecache.py jd movies <moviename> (2015-11-03, 21:23)Gizmo81 Wrote: Is there a command to rescrape/update all movies without doing one by one or removing them from library? Code: texturecache.py c movies will cache any artwork yet to be cached, whether it's local or remote, assuming the artwork is accessible to the Kodi client. Although to be honest I'm a bit confused about what you've done or what the problem is. RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2015-11-03 (2015-11-03, 21:01)Orbi Wrote: I cached my posters and fanart using the "c" option, but my discart, clearart are not being cached. I have tried looking for the answer in this thread, but I became none the wiser of it. The "c" option will cache all artwork by default, so if you've got discart, clearart, etc. in your media library then these will be cached too. Dump one of your movies to see if you really have those discart, clearart items associated with the movie, eg. "texturecache.py jd movies avatar" to see what artwork items and urls are associated with Avatar. If you definitely have those artwork items associated and you still don't think they're being cached, then run the following and upload the log to a pastebin site (change the movie name as appropriate): Code: texturecache.py c movies avatar @logfile=tc.log RE: [RELEASE] Texture Cache Maintenance utility - Gizmo81 - 2015-11-04 (2015-11-03, 23:15)Milhouse Wrote: Although to be honest I'm a bit confused about what you've done or what the problem is. OK, I will try to make it easier, was confusing myself too! I setup a mySQL server on my NAS, after that I exportet Library from RasPi2 to one single file. Then I added needed lines in advancedsettings and rebooted RasPi2. After that I imported the Library and everything looks fine. Now I prepared the FireTV, added advancedsettings and resources, rebooted and everything was there except the artworks. If I manually updated a movie artwork was loaded. I tried your tool but doesn't work. Later I found out reason was that artwork path was pointing to local path from Raspi2 where I exported the library first and new scraped stuff has online path. In meantime I rescraped whole library, but now I have to set watched state and some movie groups again. I was searching for a way to update the movies to get back the online artwork path instead of local path. RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2015-11-04 If you export the old RPi2 library to separate files then it will write the artwork and nfo files alongside the movies, which should be on your network, and when you import everything back in to create the MySQL library the network paths of artwork and movies alike will be used and accessible to both clients. There's no easy solution to fix your current MySQL database, you could use mktools.py, or SQL queries, but I think in your case it will be easier to export the old RPi2 library to separate files and then rescrape a new MySQL library. For your watched statuses you can add an advancedsettings.xml option to import watched statuses from the exported nfo files: Code: <importwatchedstate>false</importwatchedstate> <!-- import previously exported playdate and playcount from .nfo files. Defaults to false --> Code: texturecache.py watched movies backup movies.dat Code: texturecache.py watched movies restore movies.dat |