Kodi Community Forum

Full Version: Info label for Album Duration?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there one?  Looked over the wiki and couldn't come up with anything.
(2020-03-03, 22:37)YerMusic (IO) Wrote: [ -> ]Is there one?  Looked over the wiki and couldn't come up with anything.
No.  And I don't think "album duration" is a well-defined concept.  I don't know of any tag format that supports it, and I don't think album scrapers can get it at the current scrape sites.  So it isn't stored in the library.  It could be computed from the sum of the track durations at least for tracks in the library but I don't know of a way to do that in skin code.

scott s.
.
Yeah I don't think it's possible without a script of some kind.

In terms of a script - Skin Helper provides a window property of current focus album duration:
https://github.com/kodi-community-addons...usic-items

$INFO[Window(Home).Property(SkinHelper.ListItem.Duration)]
There is $INFO[Container.TotalTime] which with a quick test in Estuary seems to give desired result.

Changing the TopBar entry in MyMusicNav.xml to

xml:

<include content="TopBar">
<param name="breadcrumbs_label" value="$LOCALIZE[2]" />
<param name="sublabel">$INFO[Container.SortMethod,$LOCALIZE[31022]: , ∙ ]$INFO[Container.CurrentItem,, / ]$INFO[Container.NumItems]$INFO[Container.TotalTime,[CR]Duration Test: ,]</param>
</include>

gives

Image
@jjd-uk, this is indeed working great! What I'm looking now for is a way to offer this information in the music info dialog as well. Any ideas - without having to rely on the skin helper script? Huh
$INFO[Container.TotalTime] only works when you're within container you want the info for, what you want is to have the total duration for the album at the level above where you can display the Album music info dialog, however I'm not aware of anyway to do that.
(2020-04-12, 12:49)Chillbo Wrote: [ -> ]@jjd-uk, this is indeed working great! What I'm looking now for is a way to offer this information in the music info dialog as well. Any ideas - without having to rely on the skin helper script? Huh

a way is to save that label as a custom windowproperty (e.g. hidden button in the focusedlayout ) to store it and call it in the wished dialog.

e.g.
xml:
<control type="button">
<visible allowhiddenfocus="true">false</visible>
<onfocus condition="String.IsEqual(ListItem.DBtype,album) + !string.IsEmpty(Container.TotalTime)">SetProperty(albumduration,$INFO[Container.TotalTime],home)</onfocus>
</control>

label usage for the dialog
$INFO[Window(home).Property(albumduration)]
(2020-04-12, 15:24)mardukL Wrote: [ -> ]
(2020-04-12, 12:49)Chillbo Wrote: [ -> ]@jjd-uk, this is indeed working great! What I'm looking now for is a way to offer this information in the music info dialog as well. Any ideas - without having to rely on the skin helper script? Huh

a way is to save that label as a custom windowproperty (e.g. hidden button in the focusedlayout ) to store it and call it in the wished dialog.

e.g.
xml:
<control type="button">
<visible allowhiddenfocus="true">false</visible>
<onfocus condition="String.IsEqual(ListItem.DBtype,album) + !string.IsEmpty(Container.TotalTime)">SetProperty(albumduration,$INFO[Container.TotalTime],home)</onfocus>
</control>

label usage for the dialog
$INFO[Window(home).Property(albumduration)] 

The way I see it, saving this would only be possible, if you're in the single album view where the 'Container.TotalTime' infolabel is populated. What I'd like to do so is exactly what @jjd-uk understood: I'd like to get the album duration information while I'm one level up - in the albums overview - for each of the albums currently in focus. Or in the music info dialog for an album - which is only accessible from the albums overview and thus sharing the same issue. Or am I getting your approach wrong, @jurialmunkey?