2014-05-09, 21:45
(2014-05-09, 20:15)Lunatixz Wrote: Any chance you can make a small change to your plugin... if it's possible...
I noticed if you create a folder, copy a favorite directory. Then query super fav in json it returns the directory as a file not a directory.
Anyway to have it return it's true identity (directory)?
Root returns files and directories correctly...
Code:{
"file": "plugin://plugin.program.super.favourites/?label=Channel_100&mode=400&path=D%3A%5CXBMC%5Cportable_data%5Cuserdata%5Caddon_data%5Cplugin.program.super.favourites%5CSuper+Favourites%5CChannel_100",
"filetype": "directory",
"label": "Channel_100",
"type": "unknown"
},
Within a custom folder return is correct...but
Code:{
"files": [
{
"file": "plugin://plugin.program.super.favourites/?label=Create+New+Super+Folder&mode=500&path=D%3A%5CXBMC%5Cportable_data%5Cuserdata%5Caddon_data%5Cplugin.program.super.favourites%5CSuper+Favourites%5CChannel_100",
"filetype": "file",
"label": "Create New Super Folder",
"type": "unknown"
},
{
"file": "plugin://plugin.program.super.favourites/?label=&mode=0",
"filetype": "file",
"label": "",
"type": "unknown"
},
{
"file": "plugin://plugin.program.super.favourites/?label=Explore+XBMC+favourites&mode=300",
"filetype": "directory",
"label": "Explore XBMC favourites",
"type": "unknown"
},
{
"file": "plugin://plugin.program.super.favourites/?label=&mode=0",
"filetype": "file",
"label": "",
"type": "unknown"
},
{
"file": "plugin://plugin.program.super.favourites/?label=Latest+Episodes&mode=600&cmd=ActivateWindow%2810025%2C%22plugin%3A%2F%2Fplugin.video.cartoonworld%2F%3Fmode%3Dlatest%22%2Creturn%29",
"filetype": "file",
"label": "Latest Episodes",
"type": "unknown"
}
],
"limits": {
"end": 5,
"start": 0,
"total": 5
}
}
If you have a directory within the custom folder, it's listed as a file. "Latest Episodes is a directory"
Code:{
"file": "plugin://plugin.program.super.favourites/?label=Latest+Episodes&mode=600&cmd=ActivateWindow%2810025%2C%22plugin%3A%2F%2Fplugin.video.cartoonworld%2F%3Fmode%3Dlatest%22%2Creturn%29",
"filetype": "file",
"label": "Latest Episodes",
"type": "unknown"
}
Bit of an odd one that.
The problem is that in my code when I add a Folder I call
Code:
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, isFolder=True)
whereas when I add a Favourite I call:
Code:
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, isFolder=False)
It is really a problem with what XBMC interprets isFolder to mean; really it just means when I click this listitem this plugin will populate a new folder (ie a list), in other words in the XBMC plugin framework if a list item is flagged as a folder then the plugin is responsible for populating the next list when the item is clicked.
Therefore as far as my plugin is concerned in this instance 'Latest Episodes' isn't a folder simply because my plugin itself isn't going to being populating a new list when the item is clicked, it just calls xbmc.exceutebuiltin (which just so happens to end up with a list being populated by someone else!)
But I'll do some more digging and see if I can trick XBMC into playing nicely!
(what json command are you using?)