Trim Infolabels?
#1
Question 
I searched for a while trying to find a way to be able to use ListItem.FileName for non-library items without seeing the extension.
I'm trying to modify a skin to work with RetroPlayer and short of naming all the image files to "Gamename.nes-poster.jpg" or "Gamename.nes.jpg" there is no way to do it. If ListItem.FileName simply didn't show an extension for non-library items I could use
Code:
<texture>$INFO[ListItem.Path]\$INFO[ListItem.FileName]-poster.jpg</texture>
and
<texture>$INFO[ListItem.Path]\$INFO[ListItem.FileName]-fanart.jpg</texture>
or I could use subfolders like
Code:
<texture>$INFO[ListItem.Path]\posters\$INFO[ListItem.FileName].jpg</texture>
and
<texture>$INFO[ListItem.Path]\fanart\$INFO[ListItem.FileName].jpg</texture>

but no matter what I do, I cant remove the extension from it and can find no Infolabel that doesn't show it (ListItem.FileName, Listitem.Label, ListItem.Title, ListItem.OriginalTitle all show the extension)

Image
The above image comes from me renaming all the image files to Gamename.nes-poster.png and Gamename.nes-fanart.png

So is there a way to trim off pieces of a Infolabel? There are lots of things that I could do with that ability. Something like TrimInfo[ListItem.FileName,right,4] or TrimInfo[ListItem.Genre,left,"/"], and if used together I could do just about anything.

Is there anything like that planned or available? Is there a possibility of a new Infolabel that doesn't include the extension for non-library items?
Am I missing some smarter way of doing this?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#2
There's no way to do it via built in methods that I'm aware of.

+1 for this. Especially for genre labels!
Bitcoin donations: 1Hvo9rWzhAVbuPrshgaGZaD7qcLFTCPuiv
[Skin] Pellucid
[Skin] Maximinimalism
Reply
#3
Yeah no string manipulation methods at all at skin level, you can only do this currently using python.

Would be a great addition if it can be added
Reply
#4
Is there an Infolabel that doesn't show the extension for unknown type then?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#5
I have added a trim option to the helper service. See latest Git and the readme.
Reply
#6
Do you mean:
Code:
RunScript(script.skin.helper.service,action=stripstring&splitchar=.&string=$INFO[System.BuildVersion]&output=kodiversion_main)

It seems it would work as long as the filename doesn't also have a "." in it, it also might be hard to assign it to a listitem property though.


Short-term I was just looking for a label that doesn't display the extension for a non-library listitem (so I could add a fake image extension). It seems that it's more of a bug that Kodi shows the extension of non-library items given that you could build that label by adding the extension label to it, and that there is no way to take it away otherwise.
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply

Logout Mark Read Team Forum Stats Members Help
Trim Infolabels?0