2011-07-10, 18:33
ezechiel1917 Wrote:Hi giftie,
why does folder.py uses this json query:
Code:json_query = '{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "%s"}, "id": 1}' % ( escapeDirJSON( dir_name ), media_type )
for local trailer scraper? It takes several minutes to get content of local directory (hundreds of trailers) as it does some checking within library for all the files (there are movie,episode,music select queries in the log for every previously watched trailers) It takes several minutes before trailers starts to play. Any reason for that?
jsonrpc is used to get the exact path format that XBMC has access to. This is needed since some people do not map thier network drives and programming language now does not have 'wrapped' file access since moving to pre-Eden. The valid options for media are actually video, music, pictures, files and programs. The code is in such away that it can be used to request different media types(music for building the trivia music playlist, video for the main playlist and files for everything else(trivia) ) I just tested the code on both pre-Eden and Dharma and it does take significantly longer on pre-Eden than it does on Dharma(8x to 10x more time required on pre-Eden) This is probably because of added code(getting library file ID's which are completely unneeded in this situtation.) I'll post to a message on the development thread for JSONRPC to see if there is a way to disable this added 'feature'
Quote:Once I change the query to:
Code:json_query = '{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "files"}, "id": 1}' % ( escapeDirJSON( dir_name ) )
it gets back to normal.
This sends all the files that are located in the folder. I must specify somewhere else to only use videos(though I don't think so) this would cause files that are not video file to be added to the play list and possibly crash XBMC.
If it's not causing any problems with your system then you can leave it(which I think you will) and wait until I get this sorted out, as I can use python to sort out the unneeded files, though it is slower when compared to letting XBMC sort the files out, it will still be faster than it is in it's present state for pre-Eden..
Also what version are you using?