Accessing ListItem Info from ContextMenu
#1
From MyVideoNav.xml when bringing up the context menu on a List Item I can return any of the Info Labels with out any problems eg ListItem.DBTYPE and ListItem.DBID

However from a List control on the Homepage Home.xml when bringing up the context menu all the ListItem Info Labels are empty Sad

Is this a bug? Is there a way to get the Info Labels?
Reply
#2
Its because Home uses dynamic content containers as opposed to the fixed folderpath of a Library window which makes the focused listitem properties available to dialogs. It's the same reason why you can't use things like Container.Content() or Container.PluginCategory on the Home screen.

There's no way to get the labels from the skin side unless you set them to window properties first.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
Quote:Its because Home uses dynamic content containers as opposed to the fixed folderpath of a Library window which makes the focused listitem properties available to dialogs.

In that case then why can I call DialogVideoInfo.xml from a list item on the home page and all the info labels are available?
Reply
#4
(2020-05-02, 20:50)roidy Wrote: From MyVideoNav.xml when bringing up the context menu on a List Item I can return any of the Info Labels with out any problems eg ListItem.DBTYPE and ListItem.DBID

However from a List control on the Homepage Home.xml when bringing up the context menu all the ListItem Info Labels are empty Sad

Is this a bug? Is there a way to get the Info Labels?

What are you trying to achieve/do within the contextual Menu from Home Window ?
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#5
I'm trying to add an Artwork Beef context menu item for home screen widget list items using:-

Code:
RunScript(script.artwork.beef, mode=gui, mediatype=$INFO[ListItem.DBTYPE], dbid=$INFO[ListItem.DBID]) 

So I need DBID and DBTYPE for the list item, but list item info labels don't get passed to DialogContextMenu.xml from the home screen.
Reply
#6
(2020-05-03, 09:24)roidy Wrote: I'm trying to add an Artwork Beef context menu item for home screen widget list items using:-

Code:
RunScript(script.artwork.beef, mode=gui, mediatype=$INFO[ListItem.DBTYPE], dbid=$INFO[ListItem.DBID]) 

So I need DBID and DBTYPE for the list item, but list item info labels don't get passed to DialogContextMenu.xml from the home screen.
Ah., OK . Than i think best method is using Jurialmonkey's Approach (set property to fetch infolabels, to use them elsewhere)


Or if you didnt like set Custom Props, you can try to set an 'onclick action chain' in for your custom contextualmenu button

e.g.
xml:
<oncklick>dialog.close</onclick>
<oncklick>set.focus(?)</onclick>
<oncklick>run.script(?)</onclick> - may within Alarm clock
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#7
Create a context menu addon, example:
https://github.com/sualfred/context.embu...r/addon.py

Another approach is:
https://github.com/sualfred/script.metad...context.py

The listitem information is stored in sys once you are in the context menu.
Code:

    listitem = sys.listitem.getVideoInfoTag()
    dbid = listitem.getDbId()
    dbtype = listitem.getMediaType()

Once you have a dbid and dbtype you can call the DB for everything
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#8
@sualfred  @mardukL  Thanks guys, I'll have a play around with both methods.
Reply
#9
(2020-05-03, 08:39)roidy Wrote:
Quote:Its because Home uses dynamic content containers as opposed to the fixed folderpath of a Library window which makes the focused listitem properties available to dialogs.

In that case then why can I call DialogVideoInfo.xml from a list item on the home page and all the info labels are available?
Info dialog has special code handling to repopulate the labels when called from a dynamic list to mimic the mynav window environment.

Originally you couldn't use info dialog on widget items at all. That's only been possible since v16

You used to have to mimic the info dialog by making a fake dialog as a hidden group on home screen and then set a property oninfo to unhide it. And shortly before that, you couldn't even use oninfo - it had to be something like onup.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#10
Thanks for the explanation.
Reply

Logout Mark Read Team Forum Stats Members Help
Accessing ListItem Info from ContextMenu0