Posts: 5
Joined: Mar 2015
Reputation:
0
Hi, I'm building a webpage to display the movies available in Kodi using a Python script which queries the server using a single "VideoLibrary.GetMovies" request with some parameters (IMDB number, title and year for now) and building a simple HTML out of the JSON returned by it.
Works fine, however I'd like to have more details available to choose from, starting with each movie's resolution (video height & width, or else a simple HD 720/1080/SD tag might do the trick) and also it's associated file size in bytes or GB. As the latter may not be possible if there are stacked movies, a string containing the movie file or folder would do, whatever I can get, and then getting the size by myself through Python.
However this does not seem feasible after reading the documentation (Which is lacking, as another fellow user posted in this forum), but again I may have missed something important
Posts: 5
Joined: Mar 2015
Reputation:
0
I found streamdetails, thank you, however as the info doesn't get populated by Kodi automatically as I thought it was, I'll have to find a workaround for this instead of playing each and every library file for a couple seconds for this field to be filled...
Regarding getting the file size, I could not find the return value, sorry
Thanks!
Posts: 5,184
Joined: Jan 2009
Reputation:
131
You don't have to play every file. You just need to go into a GUI view that shows the items and Kodi will then load all the details in the background. After that all the streamdetails should also be available through JSON-RPC.
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.
Posts: 5
Joined: Mar 2015
Reputation:
0
Hi Montellese,
It seems that as I'm running Raspbmc, that option was disabled by default to free the Raspberry Pi's CPU from too much usage. Disabling it in settings has worked with no problem, and now after leaving the Pi a couple of hours the data is slowly being generated and now every movie has been analysed.
Regarding the file size, the "file" parameter returns the file path (Or paths if the movie is stacked), and then it's just a matter of using Python's os.path.getsize() or whatever other language's method to get the value and then use it.
Thank you! And sorry for the inconvenience
Posts: 146
Joined: Mar 2015
Reputation:
6
axa88
Senior Member
Posts: 146
Deciding on what video you are looking to get the resolution for, the commands are different. That ListItem command should get a video resolution of the currently selected item in your current containers list.
I would expect the VideoLibrary.GetMovieDetials method to get the currently PLAYING video info, but if as you say it doesn't, and the playing video resolution is actually what you want, then what you should try is not ListItem command but the VideoPlayer command. And the way you need to send it via jsonrpc is with the infolabel method in the xmbc namespace, not anything in VideoLibrary namespace.
Posts: 100
Joined: Sep 2010
Reputation:
3
Right, I'm only trying to show (on html, not in skin) the media flags for a given movie in the library, which is not necessarily currently playing.
AFAIK, I should use VideoLibrary.GetMovieDetials, I thought .streamdetails would give me the resolution, but it doesn't, so I ask if there is another way to get it.
Posts: 146
Joined: Mar 2015
Reputation:
6
axa88
Senior Member
Posts: 146
i should say haven't used video much so maybe should butt out, but it seems to me the the problem with montellese's suggestion is that if your trying to do work with an entirely remote client, you aren't using a GUI view (ie osd/skin...) so I might expect what he suggests not to work, especially if the media your regarding inst already scanned into your library.
So if looking to do this entirely remotely, stream details or whatever metadata at the least should be available for any media scanned into Video library using via Video.GetXXXDetails.
I would wish that any/all info is also available for non scanned items that might just be opened in a directory or list otherwise, but wouldn't be shocked if that couldn't be done.
Finally would expect that any thing currently being played, in the Video Library or not would have the info available as well (via Player.GetItem)
But for some reason any of that doesnt work via methods, i mentioned the use of info label via XBMC.