v20 listitem.setInfo('video', {'path': }) vs setPath(path='') vs setProper('path', )
#1
I want set the listitem path to realpath for get videoinfo in skin, 
I use the following 3 set functions, but got plugin://plugin.name by $INFO[Listitem,Path] in skin,
what's the diff?
listitem.setInfo(''video', {'path': curr_dir})
listitem.setPath(path=fullpathname)
listitem.setProperty('Path', curr_dir)
How set path or how get realpath like /home/kodi/abc.mp4 in MyVideo.xml?
Reply
#2
(2021-04-16, 09:59)jiamengnan Wrote: I want set the listitem path to realpath for get videoinfo in skin, 
I use the following 3 set functions, but got plugin://plugin.name by $INFO[Listitem,Path] in skin,
what's the diff?
listitem.setInfo(''video', {'path': curr_dir})
listitem.setPath(path=fullpathname)
listitem.setProperty('Path', curr_dir)
How set path or how get realpath like /home/kodi/abc.mp4 in MyVideo.xml?
Try this for Kodi 18 and below:

path = os.path.join(xbmc.translatePath("special://abc.mp4"))

For Kodi 19:

path = os.path.join(xbmcvfs.translatePath("special://abc.mp4"))

special:// gets you to Kodi's root path.  Add to it to get further into the file system.  Here's some documentation which may help.

This approach works across operating systems which support Kodi.. 


If you are wanting to stay within your addon path another option is:

addon = xbmcaddon.Addon()

path=addon.getAddonInfo("path") + '/resources/media/abc.mp4'


or better yet to your question of using InfoLabels, here's a sample of what each looks like.  I did some quick instrumentation on my addon whicih pulls content from a uPNP server so you can see the differences:

xbmc.getInfoLabel("ListItem.FileNameAndPath") = plugin://plugin.video.mezzmo/?contentdirectory=http%3a%2f%2f192.168.0.34%3a53168%2fContentDirectory%2fcontrol&mode=server&objectID=taz1l0z1l13&parentID=0

xbmc.getInfoLabel("ListItem.Path") = plugin://plugin.video.mezzmo/

xbmc.getInfoLabel("ListItem.FolderPath") = plugin://plugin.video.mezzmo/?contentdirectory=http%3a%2f%2f192.168.0.34%3a53168%2fContentDirectory%2fcontrol&mode=server&objectID=taz1l0z1l13&parentID=0


xbmc.getInfoLabel("ListItem.Path")  gives the same result as  addon.getAddonInfo("path"), the root of your addon.



Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#3
(2021-04-16, 11:13)jbinkley60 Wrote:
(2021-04-16, 09:59)jiamengnan Wrote: I want set the listitem path to realpath for get videoinfo in skin, 
I use the following 3 set functions, but got plugin://plugin.name by $INFO[Listitem,Path] in skin,
what's the diff?
listitem.setInfo(''video', {'path': curr_dir})
listitem.setPath(path=fullpathname)
listitem.setProperty('Path', curr_dir)
How set path or how get realpath like /home/kodi/abc.mp4 in MyVideo.xml?
Try this for Kodi 18 and below:

path = os.path.join(xbmc.translatePath("special://abc.mp4"))

For Kodi 19:

path = os.path.join(xbmcvfs.translatePath("special://abc.mp4"))

special:// gets you to Kodi's root path.  Add to it to get further into the file system.  Here's some documentation which may help.

This approach works across operating systems which support Kodi.. 


If you are wanting to stay within your addon path another option is:

addon = xbmcaddon.Addon()

path=addon.getAddonInfo("path") + '/resources/media/abc.mp4'


or better yet to your question of using InfoLabels, here's a sample of what each looks like.  I did some quick instrumentation on my addon whicih pulls content from a uPNP server so you can see the differences:

xbmc.getInfoLabel("ListItem.FileNameAndPath") = plugin://plugin.video.mezzmo/?contentdirectory=http%3a%2f%2f192.168.0.34%3a53168%2fContentDirectory%2fcontrol&mode=server&objectID=taz1l0z1l13&parentID=0

xbmc.getInfoLabel("ListItem.Path") = plugin://plugin.video.mezzmo/

xbmc.getInfoLabel("ListItem.FolderPath") = plugin://plugin.video.mezzmo/?contentdirectory=http%3a%2f%2f192.168.0.34%3a53168%2fContentDirectory%2fcontrol&mode=server&objectID=taz1l0z1l13&parentID=0


xbmc.getInfoLabel("ListItem.Path")  gives the same result as  addon.getAddonInfo("path"), the root of your addon.



Jeff
I try xbmcvfs.translatePath("special://" + fullpathname), cant work. result as before.
==
I open video filelist in skin.estuary, has mediaflag  bottombar with video info. note: $INFO[Listitem.Path] = /home/jia  this time.
I want not change skin, just write plugin to list files for a special folder, /home/jia/  and subdirs and files in subdirs...
but it can't show mediaflag bottombar in my listitem page, I found $INFO[Listitem.Path] = plugin://plugin.my 
I think can't show mediaflag bottombar because the listitem var path is not equal the real path like /home/jia/subdirs, so I want to set listitem.path
If set listitem.path correctly, listitem show function will read file info for bottombar show, it works? [question 1]
Files path in Folder is special real path, /home/jia, has no relations with addon folder or plugin folder.

If this set oper can change the lsititem.path. which command work? setInfo, setPath, setProperty? [question 2]

jia
Reply
#4
(2021-04-16, 12:18)jiamengnan Wrote:
(2021-04-16, 11:13)jbinkley60 Wrote:
(2021-04-16, 09:59)jiamengnan Wrote: I want set the listitem path to realpath for get videoinfo in skin, 
I use the following 3 set functions, but got plugin://plugin.name by $INFO[Listitem,Path] in skin,
what's the diff?
listitem.setInfo(''video', {'path': curr_dir})
listitem.setPath(path=fullpathname)
listitem.setProperty('Path', curr_dir)
How set path or how get realpath like /home/kodi/abc.mp4 in MyVideo.xml?
Try this for Kodi 18 and below:

path = os.path.join(xbmc.translatePath("special://abc.mp4"))

For Kodi 19:

path = os.path.join(xbmcvfs.translatePath("special://abc.mp4"))

special:// gets you to Kodi's root path.  Add to it to get further into the file system.  Here's some documentation which may help.

This approach works across operating systems which support Kodi.. 


If you are wanting to stay within your addon path another option is:

addon = xbmcaddon.Addon()

path=addon.getAddonInfo("path") + '/resources/media/abc.mp4'


or better yet to your question of using InfoLabels, here's a sample of what each looks like.  I did some quick instrumentation on my addon whicih pulls content from a uPNP server so you can see the differences:

xbmc.getInfoLabel("ListItem.FileNameAndPath") = plugin://plugin.video.mezzmo/?contentdirectory=http%3a%2f%2f192.168.0.34%3a53168%2fContentDirectory%2fcontrol&mode=server&objectID=taz1l0z1l13&parentID=0

xbmc.getInfoLabel("ListItem.Path") = plugin://plugin.video.mezzmo/

xbmc.getInfoLabel("ListItem.FolderPath") = plugin://plugin.video.mezzmo/?contentdirectory=http%3a%2f%2f192.168.0.34%3a53168%2fContentDirectory%2fcontrol&mode=server&objectID=taz1l0z1l13&parentID=0


xbmc.getInfoLabel("ListItem.Path")  gives the same result as  addon.getAddonInfo("path"), the root of your addon.



Jeff
I try xbmcvfs.translatePath("special://" + fullpathname), cant work. result as before.
==
I open video filelist in skin.estuary, has mediaflag  bottombar with video info. note: $INFO[Listitem.Path] = /home/jia  this time.
I want not change skin, just write plugin to list files for a special folder, /home/jia/  and subdirs and files in subdirs...
but it can't show mediaflag bottombar in my listitem page, I found $INFO[Listitem.Path] = plugin://plugin.my 
I think can't show mediaflag bottombar because the listitem var path is not equal the real path like /home/jia/subdirs, so I want to set listitem.path
If set listitem.path correctly, listitem show function will read file info for bottombar show, it works? [question 1]
Files path in Folder is special real path, /home/jia, has no relations with addon folder or plugin folder.

If this set oper can change the lsititem.path. which command work? setInfo, setPath, setProperty? [question 2]

jia

If .home/jia is higher or equal to Kodi in your OS path then you will likely need to use the xbmcvfs.makeLegalFilename command to make that path real and known to Kodi.  I've never used the command but it seems like it will do what you want.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#5
I looked again and that isn't going to work.  It is for creating a file not making a path known.    xbmcvfs.translatePath and xbmcvfs.validatePath are for manipulating existing path information.   Sorry I am not more helpful but it might be good to see your code.  I've typically used the xbmcplugin.addDirectoryItem command to create a window of listitems and that you pass the full path and filename for each listitem. 

You can see an example here:

xbmcplugin.addDirectoryItem(int(sys.argv[1]), 'F:\\Trailers\\300.mov', listitem, totalItems=50)

This is how I do it.

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
#6
(2021-04-16, 14:25)jbinkley60 Wrote: I looked again and that isn't going to work.  It is for creating a file not making a path known.    xbmcvfs.translatePath and xbmcvfs.validatePath are for manipulating existing path information.   Sorry I am not more helpful but it might be good to see your code.  I've typically used the xbmcplugin.addDirectoryItem command to create a window of listitems and that you pass the full path and filename for each listitem. 

You can see an example here:

xbmcplugin.addDirectoryItem(int(sys.argv[1]), 'F:\\Trailers\\300.mov', listitem, totalItems=50)

This is how I do it.

Jeff
Thank you, I got I want by xbmcplugin.addDirectoryItem(sys.argv[1], REALPATHINUNBUNTU, listitem)
My agrument REALPATHINUBUNTU is url(for pass arguments between more pages) before, the url is not realpath. and can't set path of listitem to someinfo I want to set(maybe).
Now, set realpath in OS(my os:ubuntu) on REALPATHINUBUNTU, bottombar displayed.

Thank you
Jia
Reply
#7
Glad it worked for you.


Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply

Logout Mark Read Team Forum Stats Members Help
listitem.setInfo('video', {'path': }) vs setPath(path='') vs setProper('path', )0