Kodi Community Forum

Full Version: Q: Availability of Infolabels - Custom Skin Windows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, all.

Fisrt, i am not a programmer, nor have a huge background in python.
But i try to learn...

I just go over the methods descriped here

https://alwinesch.github.io/group__pytho..._list.html

to create contextmenu addon, as i thought it'll perform better to have such actions* handled by script than via xml skinning.
   * = add item to playlist queue(last) | queue(as next)

... I came so far, that the actions itself seems correct.

But  in my Custom Window the listitems, ARE'NT RETURNED | SEEMS not Available to the script.
And beside learn some stuff the script is mostly useless Big Grin
(If i am in Media Window e.g. music,video ), it is working, but not in a custom window , which WAS THE ONLY APPROACH to do it.

The List Items itself are filled and existing in the window and the corresponding content|dbtype

May someone can help out whats going wrong here.

https://github.com/marduklev/context.playlist

queue song item - as next item
python:

# -*- coding: utf-8 -*-
import xbmc
import xbmcgui
def main():
playlist = xbmc.PlayList(xbmc.PLAYLIST_MUSIC)
songitem = xbmc.getInfoLabel('listitem.filenameandpath')
index = playlist.getposition() + 1
playlist.add(url=songitem, index=index)
xbmc.executebuiltin( 'Notification(Item Added,$INFO[listitem.Artist] - $INFO[listitem.Title])' )
if __name__ == '__main__':
main()

queue song item - as last item
python:

import xbmc
import xbmcgui
def main():
playlist = xbmc.PlayList(xbmc.PLAYLIST_MUSIC)
songitem = xbmc.getInfoLabel('listitem.filenameandpath')
playlist.add(url=songitem)
xbmc.executebuiltin( 'Notification(Item Added,$INFO[listitem.Artist] - $INFO[listitem.Title])' )
if __name__ == '__main__':
main()

Currently the only way to do so was via 'a hacky skin feature' , which seems a bit cumbersome....

- store labels in prop -> activate corresponding media window -> do builtin actions -> go back to custom window
The cyan colored context item labels use actions via xml, not via context addon which i liked to replace
https://streamable.com/3gbdtb