Truncate result of ItemLabel
#1
Hello, i'm totally new to skinning and i looked everywhere in the wikis and didn't find anything like that.

Let's suppose ListItem.FileName return the value "Fast and Furious"
Is there a way to truncate the value and get "Fast and" for example ? 

I ask that because i'm able to get tvshow path in a container with $INFO[Container.FolderPath] which will return videodb://tvshows/titles/35 and i want to truncate to keep only 35 (the tvshowid).
I haven't found any Infolabels that returns only the tvshowid.
Thanks for your help

Noustaa
Reply
#2
(2020-10-30, 22:33)Noustaa Wrote: I ask that because i'm able to get tvshow path in a container with $INFO[Container.FolderPath] which will return videodb://tvshows/titles/35 and i want to truncate to keep only 35 (the tvshowid).
I haven't found any Infolabels that returns only the tvshowid.
Thanks for your help

Noustaa

That 35 on the end is the database id and can be returned using

Code:
​​​​​​​ListItem.dbid
Reply
#3
(2020-10-31, 09:54)roidy Wrote:
(2020-10-30, 22:33)Noustaa Wrote: I ask that because i'm able to get tvshow path in a container with $INFO[Container.FolderPath] which will return videodb://tvshows/titles/35 and i want to truncate to keep only 35 (the tvshowid).
I haven't found any Infolabels that returns only the tvshowid.
Thanks for your help

Noustaa

That 35 on the end is the database id and can be returned using

Code:
ListItem.dbid
Hi, thank you for your answer!
Yes, you are right, but my problem is that my need is for episodes screen so if i use ListItem.dbid from episode screen, i will get the episode ID instead of the tvshowid. That's what happened when i tried.
Maybe i missed something with that functions ? 

Thanks
Reply
#4
retrieving the tvshowid was added to kodi v19:
https://forum.kodi.tv/showthread.php?tid...pid2937215
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
(2020-10-31, 14:02)Noustaa Wrote: Hi, thank you for your answer!
Yes, you are right, but my problem is that my need is for episodes screen so if i use ListItem.dbid from episode screen, i will get the episode ID instead of the tvshowid. That's what happened when i tried.
Maybe i missed something with that functions ? 

Thanks

Ok, so what I would do is add a hidden button to the list/panels focused layout that sets a window property if the list item is a tv show, like so:-

xml:
                    <control type="button">
                        <left>-1000</left>
                        <onfocus condition="String.IsEqual(ListItem.dbtype,tvshow)">SetProperty(tvshowdbid,$INFO[ListItem.dbid],home)</onfocus>
                    </control>

Then from your episode page just read the value back using:-

Code:
$INFO[Window(home).Property(tvshowdbid)]
Reply
#6
Hi @ronie that's good to know thank you ! Smile

@roidy thank you very much that works just great! I didn't know you can create a "variable" in another view and call it back from your custom view that's a great work around ! 
Thank you for your help, i learned something that i will be able to use again for sure !
Reply

Logout Mark Read Team Forum Stats Members Help
Truncate result of ItemLabel0