Problem with accessing information about selected item
#1
I tried to follow the instructions to
https://kodi.wiki/view/Context_Item_Add-ons
to Point 2

to get the selected listitem, without success (on both Kodi 18/19)
the sys.listitem not exists

This is the add-on test that i use:
https://www.dropbox.com/s/yam7qgh7fyinpe...u.zip?dl=0

What am i doing wrong?
Development on Kodi Netflix add-on - Skills Python, C#, VB.NET
Reply
#2
there's no kodi.context.item extension point in your addon.xml file?
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Ah no...I thought it worked anyway
I asked too much hehe Smile

so i add the menu to listitem:
menus = [('Test menu 1','RunPlugin(plugin://test.addon/?context)')]
listitem.addContextMenuItems(menus)

then after the RunPlugin callback i was thinking to get the selected item from sys
but i suppose it's not meant that way
Development on Kodi Netflix add-on - Skills Python, C#, VB.NET
Reply
#4
I haven't found a good way to get the selected listitem
Development on Kodi Netflix add-on - Skills Python, C#, VB.NET
Reply
#5
what info do you need from the listitem?
perhaps you can add whatever info you need to the RunPlugin() command?

menus = [('Test menu 1','RunPlugin(plugin://test.addon/?context&label=somevideo&path=file.ext&year=1995&duration=1685)')]
listitem.addContextMenuItems(menus)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
ah yes i understand what you means,
in this case the params are two:
TotalTime
ResumeTime

it would be possible, but i was hoping for a cleaner solution
because pass this data in to every RunPlugin URL to compose
increases the overall complexity of the code which creates the lists of directory listitem's
Development on Kodi Netflix add-on - Skills Python, C#, VB.NET
Reply



Logout Mark Read Team Forum Stats Members Help
Problem with accessing information about selected item0
This forum uses Lukasz Tkacz MyBB addons.