[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 - Milhouse - 2013-12-26 (2013-12-25, 22:26)blurp76 Wrote: Could it be some weird characted in my database? Seems unlikely given the traceback, which doesn't correspond to the usual invalid encode/decode traceback. This looks more like a fatal and unexpected error in the SQLite library/module - are you sure SQLite is installed and working correctly on the ATV, as this platform is a bit of a nightmare where SQLite is concerned. By all means PM me your Textures13.db and I'll see if I can reproduce, though I don't have an ATV but who knows - might get lucky. I would suggest trying a recent Gotham build (within last month) on the ATV as by default texturecache.py will try and use JSON to query the texture cache database on recent Gotham builds and not use diect SQLite access at all, so you shouldn't even need to install SQLite to get texturecache.py to work (with Gotham). RE: [RELEASE] Texture Cache Maintenance utility - blurp76 - 2013-12-26 (2013-12-26, 01:56)MilhouseVH Wrote: Seems unlikely given the traceback, which doesn't correspond to the usual invalid encode/decode traceback. This looks more like a fatal and unexpected error in the SQLite library/module - are you sure SQLite is installed and working correctly on the ATV, as this platform is a bit of a nightmare where SQLite is concerned.Thanks for your help, MilhouseVH! Honestly i wouldn't know how to check for error in my crystalbuntu atv installation, but it used to work in the past and i don't think i ever made any changes related to SQLite.. I tried to run this: Code: root@crystalbuntu:/home/atv# dpkg -l|grep sqlite (2013-12-26, 01:56)MilhouseVH Wrote: By all means PM me your Textures13.db and I'll see if I can reproduce, though I don't have an ATV but who knows - might get lucky.You got a PM (2013-12-26, 01:56)MilhouseVH Wrote: I would suggest trying a recent Gotham build (within last month) on the ATV as by default texturecache.py will try and use JSON to query the texture cache database on recent Gotham builds and not use diect SQLite access at all, so you shouldn't even need to install SQLite to get texturecache.py to work (with Gotham).Mmh, i'll take this in consideration, but i think i'll wait that official builds for Gotham on crystalbuntu are released, i wouldn't want to mess up my installation that is working fine except this small problem RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2013-12-26 (2013-12-26, 16:29)blurp76 Wrote: You got a PM Thanks, I've been able to reproduce on Ubuntu x86 so will try and narrow down the cause and hopefully implement a fix. Edit: The first problem row is id 889, python3 gives a more informative traceback: Code: sqlite3.OperationalError: Could not decode to UTF-8 column 'url' with text 'nfs://192.168.1.104/mnt/user/MOVIES/La fine � il mio inizio (2010)/La fine � il mio inizio.dvd-fanart.jpg' RE: [RELEASE] Texture Cache Maintenance utility - blurp76 - 2013-12-26 Ok, i did a little googling and this modification to your script seems to do the job, no idea if this has any adverse effect.. (rows 1181-1183) Code: self.mydb = lite.connect(self.config.getDBPath(), timeout=10) RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2013-12-26 Yeah, although it's a bit more involved than that if the script is also to support Python3 users, plus that fix alone causes problems for other foreign characters, and the SQLite data needs to be compatible with the data returned by JSON otherwise nothing will match... Try version 1.2.6 that I have just pushed:
RE: [RELEASE] Texture Cache Maintenance utility - stuCONNERS - 2013-12-29 can anyone help me out, im looking to automate the pre-cacheing of fanart and thumbs, to help speed up xbmc, has anyone got any pointers please RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2013-12-29 Knowing what OS would help. For Linux, you could just add a cron entry that calls the "c" option, or write a simple script and run that from cron if you want a bit more control (logging, error handling etc.). On Windows you might be able to schedule something (the "at" command?) but it's been years since I looked at Windows or scheduling batch scripts and memories that are best forgotten... RE: [RELEASE] Texture Cache Maintenance utility - stuCONNERS - 2013-12-29 openelec on raspberry pi, dont really need to see whats happening, seeing as i want to set it to run over-night. can you give me an example what id put into cron, so i can edit accordingly RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2013-12-29 1) Enable cron in the OpenELEC settings applet. 2) In SSH, enter "crontab -e" and the nano editor will start 3) Add a line as follows: Code: 0 0 * * * /storage/texturecache.py c 4) Press "CTRL-X", Y, and then RETURN 5) Confirm the cron entry has been saved with "crontab -l" (that's l as in list) 6) Confirm that /sbin/crond is running with "ps aux | grep crond" - if not, you might have to reboot the Pi. Check for crond after rebooting. With the above completed your cache will now preload at 0 (0-59) minutes past the 0 (0-23) hour on every day of the month (*, 1-31), on every month of the year (*, 1-12), on every day of the week (*, 0-6 [sun-sat]). Or in other words, it will be run at midnight every night of the year. RE: [RELEASE] Texture Cache Maintenance utility - stuCONNERS - 2013-12-29 00 06 * * /storage/texturecache.py c movies 00 06 * * /storage/texturecache.py c tvshows would those be right for 6 am caching daily? RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2013-12-29 Yes, but you might not want to run them concurrently. Code: ./texturecache.py c video would cache movies, tvshows and sets (movie sets). Alternatively this is where a simple script would help: Code: #!/bin/bash and save it as /storage/preload.sh giving it execute permission with "chmod +x /storage/preload.sh" Then in cron: Code: 00 06 * * /storage/preload.sh Now if you want to add extra steps or perform other preload tasks you just edit the script rather than add more cron entries which may overlap as you never know how long they're going to take. RE: [RELEASE] Texture Cache Maintenance utility - stuCONNERS - 2013-12-29 thanks, added ./texturecache.py c video to cron for tomorrow morning at 6.02 after a 6.00 am reboot, added rep, thank-you for the help RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2013-12-29 (2013-12-29, 03:00)stuCONNERS Wrote: thanks, added ./texturecache.py c video to cron for tomorrow morning at 6.02 after a 6.00 am reboot, added rep, thank-you for the help Make sure you use the full path rather than a relative path on cron jobs - although the job will be running as root the current directory may not be /storage when the job runs, in which case "./texturecache,py" will fail (most probably silently). I would always use /storage/texturecache,py just to be sure of what will be run. RE: [RELEASE] Texture Cache Maintenance utility - stuCONNERS - 2013-12-31 worked great, took your advice and added as a script instead, you dont how to add library(video) update to the script do you? that way i can add everything to 1 script instead after the reboot. RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2013-12-31 (2013-12-31, 03:05)stuCONNERS Wrote: you dont how to add library(video) update to the script do you? Code: /storage/texturecache.py vscan |