Kodi Community Forum

Full Version: Does Album_Duration or ListItem.Duration (for Albums) actually work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Simple question but it is really annoying me.

I am running a modded version of the Silvio skin. I have amended up the widget info panel (in includes_widgets.xml) and also checked in the DialogMusicInfo.xml.  What I want to do is show the runtime/duration of an album or if the widget was pointing to songs, the runtime of the song.

However, no matter what I do, no information is pulled by Kodi for either the widget info panel or the DialogMusicInfo window.  The info is in music info database, I checked.

So is it that Kodi cannot pull that information, is there some "secret sauce" in terms of syntax in the xmls to pull that info correctly that I do not know about or is it something else?
Hmm, what have you "amended"?

FWIW, this is my DialogMusicInfo window showing album duration in the right panel.

Image
(2021-09-17, 19:24)black_eagle Wrote: [ -> ]Hmm, what have you "amended"?

FWIW, this is my DialogMusicInfo window showing album duration in the right panel.

Image

It is even weirder than I first thought.

If I set up a widget for random albums - standard widget which I think comes from the library data provider add on (ie standard mainstream kodi) and then use the "I" key to get information for that album it goes to Window (songinformation) which is wrong, it should go to Window(musicinformation).  And that will not provide the Duration of the album.

If on the other hand I navigate to the same album via - music library/albums and then click on the "I" key I go to Window(musicinformation) which does provide the album duration.  

I tried the same with songs, set up a widget "Random Songs" which again I think is via the library data provider add on.  Exactly the same problem as for albums.

Now that brings me the widget info panel.  This is the Silvio skin so you start in template.xml (for the widget template via skin.shortcuts) and that calls an <include> from include_widgets.xml. and that includes determines what information is presented where - the information being a series of variables found in variable_widgets.xml.

For simplicity sake assume the relevant variable is called MyVariable.  My variable will have a series of values depending on what the widget is pointing to but one of those values is going to be <value condition="String.IsEqual(Container.ListItem.DBTYPE,album)">Duration: $INFO[something]</value>.

I have tried every possible coding for the $INFO[something] part and I get nothing.  For the something I have tried

Container.ListItem.Property(Album_Duration)
Container.ListItem.Duration
Window(musicinformation).Property(ListItem.Duration)
Window(songinformation).Property(ListItem.Duration)

None of them work. Yet if you go into the DialogMusicInfo.xml - ListItem.Duration is used and works, but as I said only if you go to that window via music library/album and I key (or equivalent for songs)
(2021-09-17, 20:14)justin150 Wrote: [ -> ]standard widget which I think comes from the library data provider add on (ie standard mainstream kodi)

Err, that's not standard.  That's an addon (presumably installed by the skin, although I haven't checked that).

I'm certainly no skinner, but looking at the xml, the album duration for DialogMusicInfo comes from Includes_MusicInfo.xml, specifically https://github.com/xbmc/xbmc/blob/master...l#L96-L100 where ListItem.Property(Album_Duration) is set by core.  Perhaps a skilled skinner such as @jjd-uk , @Hitcher or @ronie can confirm this.

Looks to me like this might be a skin issue with how the widgets you are using fetch info from Kodi core.  @mikeSiLVO is probably the best person to ask about that.
According to the README for service.library.data.provider there is no duration value provided.

Albums:
  • ListItem.Title
  • ListItem.Artist
  • ListItem.Genre
  • ListItem.Year
  • ListItem.Rating
  • ListItem.Property(Album_Mood)
  • ListItem.Property(Album_Style)
  • ListItem.Property(Album_Theme)
  • ListItem.Property(Album_Type)
  • ListItem.Property(Album_Label)
  • ListItem.Property(Album_Description)
  • ListItem.Icon DefaultAlbumCover.png
  • ListItem.Thumb
  • ListItem.Property(fanart_image)
  • ListItem.Property(dbid)
(2021-09-17, 23:51)black_eagle Wrote: [ -> ]
(2021-09-17, 20:14)justin150 Wrote: [ -> ]standard widget which I think comes from the library data provider add on (ie standard mainstream kodi)

Err, that's not standard.  That's an addon (presumably installed by the skin, although I haven't checked that).

I'm certainly no skinner, but looking at the xml, the album duration for DialogMusicInfo comes from Includes_MusicInfo.xml, specifically https://github.com/xbmc/xbmc/blob/master...l#L96-L100 where ListItem.Property(Album_Duration) is set by core.  Perhaps a skilled skinner such as @jjd-uk , @Hitcher or @ronie can confirm this.

Looks to me like this might be a skin issue with how the widgets you are using fetch info from Kodi core.  @mikeSiLVO is probably the best person to ask about that.
Never even thought about looking in that ReadMe as I was going from the list of infoLabels Kodi provides as a default.  Thank you

Looks as though there needs to be a small update in the Library Data Provider code if I am going to use that add on - it doesn't look as though it has been updated for several years (if it works well why meddle!) and there may be a better/modern way of getting data for Random Albums/Random Songs for a widget so that it refreshes.  Having had a quick look at the code I may try updating the code and see if I can get it work