•   
  • 1
  • 104
  • 105
  • 106(current)
  • 107
  • 108
  • 188
  •   
[RELEASE] Texture Cache Maintenance utility
(2015-08-13, 20:06)Milhouse Wrote: Kodi will re-encode the urls before storing them - give it a try on one of your movies, or try it manually at the command line:

Code:
./texturecache py set movie #### art.poster "<url suggested by fixup.dat>"

where #### is the movieid of the movie.

If davs:// urls require addition encode processing then I guess something will need to be done about that (not sure what, exactly).

Doesn't seem to actually do that. It stores them unencoded if you've asked it to via the py script. I'm not sure if this will cause problems. This is data for that movie. I compared it to other URLs and all the rest are encoded. I searched ALL URLs for one of parenthesis, comma, ampersand, etc and the only hits I got are for my 'test' movie. I'm thinking this may break things if its not encoded as a url before upload.

Code:
mysql> select url from art where url like '%Lock%';
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| url                                                                                                                                                                                                         |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| davs://xxxxx/base/Media/Videos/Movies/Lock,.Stock.and.Two.Smoking.Barrels.(1998).720p.bluray.h264/Lock,.Stock.and.Two.Smoking.Barrels.(1998).720p.bluray.h264-fanart.jpg |
| davs://xxxxxxx/base/Media/Videos/Movies/Lock,.Stock.and.Two.Smoking.Barrels.(1998).720p.bluray.h264/Lock,.Stock.and.Two.Smoking.Barrels.(1998).720p.bluray.h264-poster.jpg |
                                                                                    |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3 rows in set (0.01 sec)
Reply
OK, try this test version of texturecache.py: http://sprunge.us/gELh

It will partially re-quote dav/davs urls before setting them into the media library.

(note the following is a dry-run, also I'm using your test data for the poster which is clearly not a valid poster!)
Code:
$ ./texturecache.py testset movie 2395 art.poster "davs://xxxx/base/Media/Videos/Movies/Lock,.Stock.and.Two.Smoking.Barrels.(1998).720p.bluray.h264/Lock,.Stock.and.Two.Smoking.Barrels.(1998).720p.bluray.h264.mp4"
### DRY RUN ###
{
  "params": {
    "art": {
      "poster": "davs://xxxx/base/Media/Videos/Movies/Lock,.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264/Lock,.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264.mp4"
    },
    "movieid": 2395
  },
  "method": "VideoLibrary.SetMovieDetails"
}
### DRY RUN ###

When the above is applied to the media library, Kodi will quote/encode the % from %28 and %29 as %25, so you'll end up with "j movies" returning:
Code:
"poster": "image://davs%3a%2f%2fxxxx%2fbase%2fMedia%2fVideos%2fMovies%2fLock%2c.Stock.and.Two.Smoking.Barrels.%25281998%2529.720p.bluray.h264%2fLock%2c.Stock.and.Two.Smoking.Barrels.%25281998%2529.720p.bluray.h264.mp4/"
and the decoded version of the above is:
Code:
"poster": "image://davs://xxxx/base/Media/Videos/Movies/Lock,.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264/Lock,.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264.mp4/"
which I think is what you were getting at the beginning.
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
It's partially correct. It looks to be encoding the parenthesis correctly (and ampersands from another movie I looked at ) but it is not doing the commas where as when xbmc originally encoded them it encoded the commas as well.



Code:
ORIGINAL EXAMPLE OF URL based off of file name:
mysql> select c22 from movieview where idFile = 123;
+---------------------------------------------------------------------------------------------------------------------------------------------+
| c22                                                                                                                                         |
+---------------------------------------------------------------------------------------------------------------------------------------------+
| davs://xxxx/base/Media/Videos/Movies/Lock%2c.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264/ |
+---------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


after with test py:

->$ cat try.dat | ./tbeta.py testset
### DRY RUN ###                                        
{
  "params": {
    "art": {
      "fanart": "davs://xxxx/base/Media/Videos/Movies/Lock,.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264/Lock,.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264-fanart.jpg",
      "poster": "davs://xxxx/base/Media/Videos/Movies/Lock,.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264/Lock,.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264-poster.jpg"
    },
    "movieid": 123
  },
  "method": "VideoLibrary.SetMovieDetails"
}
### DRY RUN ###

->$  ./texturecache.py j movies | grep Lock
    "file": "davs://xxxx/base/Media/Videos/Movies/Lock%2c.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264/Lock%2c.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264.mp4",
    "label": "Lock, Stock and Two Smoking Barrels",
    "title": "Lock, Stock and Two Smoking Barrels"
Reply
You can try this new test version of texturecache.py: http://sprunge.us/iRRJ

But I'm not sure this is going to be easy to solve, as Kodi is re-quoting various characters which is beyond my control - if we quote "," to "%2c" (which is what the new test version will do) then you'll end up with "j movies" returning "Lock%252c"

I'm beginning to think this may not be solvable, or the error is in the source material (should it be quoted in this way?) Is this a SQLite db, it might be easier if you PM me a copy of your MyVideos9x.db.
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'll give it a try. I'm confused as to why kodi is encoding some of these to begin with. According to RFC, for example, parenthesis are "safe". I can see commas and ampersands being encoded though as those are unsafe.

What I can do, if you want, is create a url with all us-ascii characters in it and determine pretty quickly what kodi seems to want encoded when it is originally scanned. This script should then be able to simulate that for dav/davs. I would think it would use the same scheme for http/https but not sure but I can test it.

reference:
http://www.ietf.org/rfc/rfc1738.txt

btw, its a mysql database but i can give you a sanitized dump of it.
Reply
It might be easier if you can scrape a handful of davs:// movies into a SQLite db and upload it somewhere - I really need an original database otherwise there's too many layers of translation going on.
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 should be able to do that in a sqllite real quick. This is interesting though. It seems kodi is encoding almost everything. What a mess.

Code:
->$ ls -l /data/Media/Videos/Movies/Lock*/*mp4
Lock,.Stock.and.Two.Smoking.Barrels.(1998)[email protected]#$%^&*()_+=<>?:";,.\\|`~{}.mp4
Code:
mysql> select url from art where url like '%Lock%fan%';
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| url                                                                                                                                                                                                                                                                                                     |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| davs://xxxxxx/base/Media/Videos/Movies/Lock%2c.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h2641/Lock%2c.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264.%21%40%23%24%25%5e%26%2a%28%29_%2b%3d%3c%3e%3f%3a%22%3b%2c.%5c%5c%7c%60~%7b%7d-fanart.jpg |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

mysql> select * from files where strfilename like '%Lock%';
+--------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------------------+---------------------+
| idFile | idPath | strFilename                                                                                                                                          | playCount | lastPlayed          | dateAdded           |
+--------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------------------+---------------------+
|   1864 |    463 | Lock%2c.Stock.and.Two.Smoking.Barrels.%281998%29.720p.bluray.h264.%21%40%23%24%25%5e%26%2a%28%29_%2b%3d%3c%3e%3f%3a%22%3b%2c.%5c%5c%7c%60~%7b%7d.mp4 |      NULL | 2015-07-29 00:00:00 | 2015-08-13 16:34:36 |
+--------+--------+------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------------------+---------------------+
1 row in set (0.00 sec)
Reply
Is there any way to send a new line character? I've tried using \n but the backslash just gets escaped.

Code:
[email protected]:~$ ./texturecache.py testset artist 123 description "line one\nline two"
### DRY RUN ###
{
  "params": {
    "artistid": 123,
    "description": "line one\\nline two"
  },
  "method": "AudioLibrary.SetArtistDetails"
}
### DRY RUN ###
Reply
(2015-08-15, 18:28)Zippy79 Wrote: Is there any way to send a new line character? I've tried using \n but the backslash just gets escaped.

Should be fixed in v2.0.10. Passing "\n" from the command line will now work correctly.

Edit: Had to push v2.1.0 due to a problem with the version comparison, apparently "2.0.10" isn't greater than "2.0.9"... use the fupdate option if the new version isn't being detected.
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
v2.1.1: Add support for VideoLibrary.RefreshFoo methods during qax for movies and tvshow episodes.. Should be a bit faster and more reliable than the old "remove item and re-scan" approach (which can still be used if you specify @qa.useoldrefreshmethod=yes). See PR7306 for more details.
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-08-15, 21:32)Milhouse Wrote: Should be fixed in v2.0.10. Passing "\n" from the command line will now work correctly.

Thanks very much Milhouse. Confirmed working.
Reply
Thanks so much for this tool MilHouse. It's become the most useful way to interact with Kodi for me. Have you considered expanding/rebranding texturecache to become *the* defacto Kodi command line control program?

More specific question ... if running OpenELEC 5.0.8 with the latest YouTube plugin installed, should I be able to use texturecache's play option to load a YouTube clip with a syntax as simple as this:

Code:
$ ./texturecache.py play https://www.youtube.com/watch?v=qT4e91vR4Qo

Edit: I'm guessing the https might be the first stumbling block?

Thanks!
rPD
Reply
(2015-08-17, 02:11)raspberry_pd Wrote: Thanks so much for this tool MilHouse. It's become the most useful way to interact with Kodi for me. Have you considered expanding/rebranding texturecache to become *the* defacto Kodi command line control program?

Certainly no plans to rebrand despite the current name having become increasingly inaccurate as more functionality is added. Wish I'd thought ahead on that one! Smile

It probably already is the most complete command line control program for Kodi, but if you have any ideas for new features, let me know...

(2015-08-17, 02:11)raspberry_pd Wrote: More specific question ... if running OpenELEC 5.0.8 with the latest YouTube plugin installed, should I be able to use texturecache's play option to load a YouTube clip with a syntax as simple as this:

Code:
$ ./texturecache.py play https://www.youtube.com/watch?v=qT4e91vR4Qo

Edit: I'm guessing the https might be the first stumbling block?

Thanks!
rPD

No, but the following will work:
Code:
./texturecache.py play plugin://plugin.video.youtube/play/?video_id=qT4e91vR4Qo
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-08-17, 02:32)Milhouse Wrote:
(2015-08-17, 02:11)raspberry_pd Wrote: Thanks so much for this tool MilHouse. It's become the most useful way to interact with Kodi for me. Have you considered expanding/rebranding texturecache to become *the* defacto Kodi command line control program?

Certainly no plans to rebrand despite the current name having become increasingly inaccurate as more functionality is added. Wish I'd thought ahead on that one! Smile

Yeah bit tricky I guess.

Milhouse Wrote:It probably already is the most complete command line control program for Kodi, but if you have any ideas for new features, let me know...

Yeah I wasn't suggesting it's not already but hmmm, you might regret offering to accept new feature requests, LOL. Smile

Actually that reminds me ... not necessarily a new feature request, but when doing cleans like vclean, can the video title be output along with the id? Hopefully this doesn't require much code or slow things down.

(2015-08-17, 02:11)raspberry_pd Wrote: More specific question ... if running OpenELEC 5.0.8 with the latest YouTube plugin installed, should I be able to use texturecache's play option to load a YouTube clip with a syntax as simple as this:

Code:
$ ./texturecache.py play https://www.youtube.com/watch?v=qT4e91vR4Qo

Edit: I'm guessing the https might be the first stumbling block?

Thanks!
rPD

Milhouse Wrote:No, but the following will work:
Code:
./texturecache.py play plugin://plugin.video.youtube/play/?video_id=qT4e91vR4Qo

Indeed it does! Thanks. So this highlights my thinking about kinda re-jigging the tool's erm, image / orientation, something like that. Despite your great ---help inline documentation, there appears to be so much that can be done with texturecache / the JSON-RPC API, that is unknown unless people read this thread and reading threads this long is quite a task Smile I wonder if there's a more focused and simpler way to document handy tasks that can be completed with texturecache? Some sort of how-to or whatnot? Wish I had a more specific idea but without wanting to criticize existing efforts, I do think this great tool could do with more/simpler/different documentation in some sort of tips and tricks format. Maybe I should start a blog? Nah, doesn't seem right. Some pages in your GitHub repo? Maybe?!!
Reply
(2015-08-17, 03:29)raspberry_pd Wrote: Some pages in your GitHub repo? Maybe?!!

Kodi Wiki would be more appropriate.

It's unlikely I'll be adding significantly to the documentation for this utility, beyond what already exists. Most people seem able to work out what to do from the built-in help and existing documentation, and you can always look at the logfile to see the JSON requests that are being generated, and if you have a JSON problem then refer to the JSON-RPC documentation for help on what is valid and what isn't. Failing that, ask a question in the forum.

In the case of your YouTube url, all I did was enable debug logging in Kodi and play a random video using the YouTube addon, then extracted the most likely looking url and tried it with texturecache.py play - it worked. I then modified the url so that it played your video. Repeating this for any other addon is probably the easiest solution when trying to work out what the video url needs to be.
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
  • 104
  • 105
  • 106(current)
  • 107
  • 108
  • 188
  •   
 
Thread Rating:
  • 17 Vote(s) - 4.76 Average



Logout Mark Read Team Forum Stats Members Help
[RELEASE] Texture Cache Maintenance utility4.7617
This forum uses Lukasz Tkacz MyBB addons.