Remove file extension from ListItem.Filename
#1
Hello, I'm trying to remove the file extension from the InfoLabel ListItem.Filename, I just want to get the name and remove the extension, is there a way to do it? if not, is there a way to call an external python file to do it?

This is what I'm trying to do:

PHP Code:
<control type="button" id="12" description="Search">
<
posx>0</posx>
<
posy>0</posy>
<
width>400</width>
<
height>60</height>
<
textoffsetx>10</textoffsetx>
<
align>center</align>
<
label>Search</label>
<
onclick>Container.Update(plugin://plugin.video.search/search?query=$INFO[ListItem.Filename])</onclick>
<visible>System.HasAddon(plugin.video.search)]</visible>
</
control

Any advice and suggestions will be greatly appreciated

Thank you!
Reply
#2
Just to answer myself if anyone wonders how to do it, I had to code a little python script and call it from the skin.

DialogContextMenu.xml

PHP Code:
<control type="button" id="12" description="Search">
<
posx>0</posx>
<
posy>0</posy>
<
width>400</width>
<
height>60</height>
<
textoffsetx>10</textoffsetx>
<
align>center</align>
<
label>Search</label>
<
onclick>RunPlugin(plugin://script.search/search.py?query=$INFO[ListItem.FileName])</onclick>
<visible>System.HasAddon(plugin.video.myplugin)]</visible>
</
control

search.py

PHP Code:
query sys.argv[2]
queryc query.replace('.strm','')
xbmc.executebuiltin('Container.Update(plugin://plugin.video.myplugin/search' queryc)') 

If you know a better way please let me know.

Cheers!!
Reply
#3
Has anyone figured out a better solution for this? I am working on a custom skin where this would be ridiculously helpful.

If not, can one of the devs please add a ListItem.FilenameNoExtension?
Reply
#4
Have you tried disabling Settings -> Appearance -> File lists -> Show file extensions?
Image
Reply

Logout Mark Read Team Forum Stats Members Help
Remove file extension from ListItem.Filename0