2015-01-11, 18:33
Hi,
I'm trying to create my first addon, so my XBMC-vocabulary may not be precise yet, feel free to correct it .
I'm trying to create an addon that will search through my "source" directories, and display the files from those directories. I also want to display the metadata for files that were already added to my database (scrapped). The behavior I'm looking for is quite similar to what can be found in the "Videos/files" menu in XBMC. See image below.
I'm mostly interested in the informations displayed on the left (when available) and on the "Movie Information" tab in the context menu. My goal is to apply for each file a specific process, and then to hide the processed files (like the watched/unwatched status). Maybe there is a way to include that directly in the file browser, but I'm not aware of that.
Now, let's start with what I already tried :
I first tried to reproduce that behavior for files that were already added to my database (retrieved through the jsonrpc method "VideoLibrary.GetMovies").
Once i retrieved my list of movies, I displayed them using :
However, when doing so, I'm not getting the "Movie information" tab in the context menu. I still have the other menu items though ("mark as watched", "add to favourites", "play", etc...), and i can play the file from there, so I guess the link is correct.
What am I missing ? Is it possible to achieve ?
Then, I list files retrieved from a call to the jsonrpc method "Files.GetDirerctory" (for a given source). I'm then trying to retrieve metadata for these files from the previous list.
But this is very long, since I have to manually find which metadata set corresponds to each file (which means lots of lookups in a large dict - very slow, especially in python)
Is there a more straightforward way to reproduce the behavior of XBMC's native file browser ? Maybe something to directly retrieve metadata associated to a given file if any ?
Thanks in advance,
BePov
I'm trying to create my first addon, so my XBMC-vocabulary may not be precise yet, feel free to correct it .
I'm trying to create an addon that will search through my "source" directories, and display the files from those directories. I also want to display the metadata for files that were already added to my database (scrapped). The behavior I'm looking for is quite similar to what can be found in the "Videos/files" menu in XBMC. See image below.
I'm mostly interested in the informations displayed on the left (when available) and on the "Movie Information" tab in the context menu. My goal is to apply for each file a specific process, and then to hide the processed files (like the watched/unwatched status). Maybe there is a way to include that directly in the file browser, but I'm not aware of that.
Now, let's start with what I already tried :
I first tried to reproduce that behavior for files that were already added to my database (retrieved through the jsonrpc method "VideoLibrary.GetMovies").
Once i retrieved my list of movies, I displayed them using :
Code:
item = [one line of the result from a "VideoLibrary.GetMovies" call]
url = item['file"]
filename = ntpath.basename(url)
li = xbmcgui.ListItem(filename, thumbnailImage=item["thumbnail"])
li.setInfo(type='video', infoLabels={'year':item["year"],
'title': item["label"],
'director': str(item["director"]),
'plot': item["plot"] })
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)
However, when doing so, I'm not getting the "Movie information" tab in the context menu. I still have the other menu items though ("mark as watched", "add to favourites", "play", etc...), and i can play the file from there, so I guess the link is correct.
What am I missing ? Is it possible to achieve ?
Then, I list files retrieved from a call to the jsonrpc method "Files.GetDirerctory" (for a given source). I'm then trying to retrieve metadata for these files from the previous list.
But this is very long, since I have to manually find which metadata set corresponds to each file (which means lots of lookups in a large dict - very slow, especially in python)
Is there a more straightforward way to reproduce the behavior of XBMC's native file browser ? Maybe something to directly retrieve metadata associated to a given file if any ?
Thanks in advance,
BePov