ParentPath (..) during Addons.ExecuteAddon
#1
Goal: using json-rpc open a folder inside of the addon.
Problem: ParentPath (..) is the same as current folder
json-rpc example:
{
    "jsonrpc": "2.0",
    "method": "Addons.ExecuteAddon",
    "params": {
        "wait": false,
        "addonid": "plugin.audio.kxmxpxtx.bandcamp",
        "params": {
            "mode": "url",
            "url": "https%3A%2F%2Fshlemrock.bandcamp.com%2Ftrack%2F--7"
        }
    },
    "id": 1
}
Handler inside of the addon (https://github.com/Virusmater/plugin.aud...ee/develop):

...
elif mode[0] == 'url':
   url = args.get("url", None)[0]
   build_song_list(*bandcamp.get_album_by_url(url))
...
def build_song_list(band, album, tracks):
   track_list = list_items.get_track_items(band=band, album=album, tracks=tracks)
   xbmcplugin.addDirectoryItems(addon_handle, track_list, len(track_list))
   xbmcplugin.setContent(addon_handle, 'songs')
   xbmcplugin.endOfDirectory(addon_handle)
...
Logs:
pocehatabi.kodi (paste)

Main point is:
Code:
2020-05-17 16:54:38.870 T:140581577232320 DEBUG: ParentPath = [plugin://plugin.audio.kxmxpxtx.bandcamp/?mode=url&url=https%3A%2F%2Fshlemrock.bandcamp.com%2Ftrack%2F--7]
The same as parameters I'm calling the addon with. So when I navigate to the parent folder - same folder opens up.Is there any way to set ParentPath to something else?
Reply
#2
Looks like there is a bug. I tried to do the same with GUI.ActivateWindow
Worked the same way as Addons.ExecuteAddon

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "GUI.ActivateWindow",
    "params": {
        "window": "music",
        "parameters": [
            "plugin://plugin.audio.kxmxpxtx.bandcamp?mode=url&url=https://shlemrock.bandcamp.com/track/--7"
        ]
    }
}
And then after reading a lot of different posts on the forum tried to add "/" before "?"

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "GUI.ActivateWindow",
    "params": {
        "window": "music",
        "parameters": [
            "plugin://plugin.audio.kxmxpxtx.bandcamp/?mode=url&url=https://shlemrock.bandcamp.com/track/--7"
        ]
    }
}
and that time parent folder was the root of the plugin.
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
ParentPath (..) during Addons.ExecuteAddon00
This forum uses Lukasz Tkacz MyBB addons.