No album art thumbnails
#1
Hi,

Sorry if this is dumb question, I'm still a Kodi beginner, even though I'm already into skinning  Wink

I only get "placeholder" (music notes) thumbnails when I'm browsing for songs / listening to music, be it radio stations via the Radio add-on, or songs pulled off my UPnP server (TwonkyServer).

What am I missing to get the album art in place of these placeholders?

On the UPnP side of the equation, shouldn't Kodi pull the icon from the server?

On the radio side of the equation, is there a means to have Kodi get the icon from some online provider, based on artist / album or artist / song title?

Thanks a lot in advance for your help.
Reply
#2
UPnP, I have no idea !!

Radio stations - I wrote an addon that does just this.  It needs skin support, but as you're messing about with Estouchy I think you'll probably be able to figure out what to add and where. If you get stuck, shout out.

The addon sets art and info properties based upon the currently playing artist and song.  There are settings to swap the artist and track if the radio station transmits 'artist name - track name' or 'track name - artist name'.  You can also 'pretty up' the radio station name so that for instance '11254' becomes 'Planet Rock'.

It will pull album art, artist art, logo etc and cache all that locally if no local art exists, else it wil use any local art found and download and cache the rest (if any).  It will also get album and track reviews and comments which can also be displayed if you want. This is also cached locally.  I am in the process of updating it to use the art features added by DaveBlake to Kodi V18 where all available art is included in the db.  This is only partially completed though so the addon works best if you have a 'drive://share/music/artist/album' type structure for your music, with album art and disc art alongside the album tracks although it will use any local art found by either means.

Linky -> https://github.com/the-black-eagle/scrip...dio.helper
Learning Linux the hard way !!
Reply
#3
(2019-09-28, 22:39)black_eagle Wrote: UPnP, I have no idea !!

Radio stations - I wrote an addon that does just this.  It needs skin support, but as you're messing about with Estouchy I think you'll probably be able to figure out what to add and where. If you get stuck, shout out.

The addon sets art and info properties based upon the currently playing artist and song.  There are settings to swap the artist and track if the radio station transmits 'artist name - track name' or 'track name - artist name'.  You can also 'pretty up' the radio station name so that for instance '11254' becomes 'Planet Rock'.

It will pull album art, artist art, logo etc and cache all that locally if no local art exists, else it wil use any local art found and download and cache the rest (if any).  It will also get album and track reviews and comments which can also be displayed if you want. This is also cached locally.  I am in the process of updating it to use the art features added by DaveBlake to Kodi V18 where all available art is included in the db.  This is only partially completed though so the addon works best if you have a 'drive://share/music/artist/album' type structure for your music, with album art and disc art alongside the album tracks although it will use any local art found by either means.

Linky -> https://github.com/the-black-eagle/scrip...dio.helper

Thanks for the quick response!

I'm experimenting with your add-on and the first station I have (kinda randomly) picked up sends the 'track' as something like:

<artist> - <title> || 3756 || S

As a result, instead of the artist I get:

<title> || 3756 || S

I'll try to look at your code and change it so that it can detect this kind of formatting...

(which means I will to learn enough Python to be able to do that  Wink ...)

Next to that, further down the line I will need to be able to detect whether MusicOSD.xml (more specifically, PlayerControlCommons in IncludesPlayerControls.xml) is used for streaming radio / the properties you're adding do exist as opposed to other uses (e.g. my UPnP use case) so that the standard properties e.g. $INFO[MusicPlayer.Artist] are used instead of yours e.g. $INFO[Window(12006).Property(srh.Artist)]. Can you help me out with that? For instance, is there a "if exist" mechanism that can be used in skin XML code?
Reply
#4
(2019-09-29, 09:17)sba923 Wrote:
(2019-09-28, 22:39)black_eagle Wrote: UPnP, I have no idea !!

Radio stations - I wrote an addon that does just this.  It needs skin support, but as you're messing about with Estouchy I think you'll probably be able to figure out what to add and where. If you get stuck, shout out.

The addon sets art and info properties based upon the currently playing artist and song.  There are settings to swap the artist and track if the radio station transmits 'artist name - track name' or 'track name - artist name'.  You can also 'pretty up' the radio station name so that for instance '11254' becomes 'Planet Rock'.

It will pull album art, artist art, logo etc and cache all that locally if no local art exists, else it wil use any local art found and download and cache the rest (if any).  It will also get album and track reviews and comments which can also be displayed if you want. This is also cached locally.  I am in the process of updating it to use the art features added by DaveBlake to Kodi V18 where all available art is included in the db.  This is only partially completed though so the addon works best if you have a 'drive://share/music/artist/album' type structure for your music, with album art and disc art alongside the album tracks although it will use any local art found by either means.

Linky -> https://github.com/the-black-eagle/scrip...dio.helper

Thanks for the quick response!

I'm experimenting with your add-on and the first station I have (kinda randomly) picked up sends the 'track' as something like:

<artist> - <title> || 3756 || S

As a result, instead of the artist I get:

<title> || 3756 || S

I'll try to look at your code and change it so that it can detect this kind of formatting...

(which means I will to learn enough Python to be able to do that  Wink ...)

Next to that, further down the line I will need to be able to detect whether MusicOSD.xml (more specifically, PlayerControlCommons in IncludesPlayerControls.xml) is used for streaming radio / the properties you're adding do exist as opposed to other uses (e.g. my UPnP use case) so that the standard properties e.g. $INFO[MusicPlayer.Artist] are used instead of yours e.g. $INFO[Window(12006).Property(srh.Artist)]. Can you help me out with that? For instance, is there a "if exist" mechanism that can be used in skin XML code?  

This very experimental piece of code seems to work:

                    if " || " in current_track:
                        x = slice_string(current_track, " || ", 1)
                        y = current_track[:x]
                        y = y.strip()
                        z = slice_string(y, " - ", 1)
                        artist = y[:z]
                        track = y[z + 3:]
                    else:
                        x = slice_string(current_track, ' - ', 1)
                        artist = current_track[x + 3:]
                        track = current_track[:x]


but I'm facing something rather strange: the script doesn't seem to run as soon as I switch to the music OSD. I have to click on the Kodi icon at the top left corner, at which point the add-on's configuration dialog pops up. When I click OK there and then return to the music OSD, the script does run. What's up, doc?
Reply
#5
To get it run when you switch to the music OSD you need to add
xml:
<onload condition="System.HasAddon(script.radio.streaming.helper)">RunScript(script.radio.streaming.helper)</onload>
to MusicVisualisation.xml

It needs to be inside the <window> tag at the top of the file.  eg

xml:
<?xml version="1.0" encoding="utf-8"?>
<window>
    <onload condition="System.HasAddon(script.radio.streaming.helper)">RunScript(script.radio.streaming.helper)</onload>
    <onload condition="System.HasAddon(script.artistslideshow)">RunScript(script.artistslideshow)</onload>
 
    <defaultcontrol></defaultcontrol>
    <backgroundcolor>background</backgroundcolor>
    <controls>

You'll need to point it to your music library in the addon settings, else it will keep asking for the location.
(2019-09-29, 09:17)sba923 Wrote: Next to that, further down the line I will need to be able to detect whether MusicOSD.xml (more specifically, PlayerControlCommons in IncludesPlayerControls.xml) is used for streaming radio / the properties you're adding do exist as opposed to other uses (e.g. my UPnP use case) so that the standard properties e.g. $INFO[MusicPlayer.Artist] are used instead of yours e.g. $INFO[Window(12006).Property(srh.Artist)]. Can you help me out with that? For instance, is there a "if exist" mechanism that can be used in skin XML code?

I'm not totally clear on what you're asking here but if it's what I think it is, you can use the <visible> tag to show or hide the extra properties depending on whether the currently playing file is a stream or a local track.

For example, <visible>!Pvr.IsPlayingRadio + !Player.IsInternetStream</visible> will only show that control for a locally playing track.  If either of those conditions are true (so Kodi is playing either a stream or a radio station from a pvr backend) then it won't be shown.

You can also use !StringIsEmpty(Window(Visualisation).Property(srh.SomeProperty)) to determine whether or not that particular property contains a value and then show or hide the control accordingly.


xml:
<control type="image">
                        <depth>DepthOSD+</depth>
                        <left>15</left>
                        <bottom>5</bottom>
                        <width>405</width>
                        <height>405</height>
                        <aspectratio aligny="bottom" align="center">keep</aspectratio>
                        <texture background="true" fallback="DefaultAudio.png">$VAR[MusicPlayerCover]</texture>
                        <bordersize>20</bordersize>
                        <visible>Player.HasAudio + Window.IsVisible(MusicVisualisation.xml) + !Pvr.IsPlayingRadio + !Player.IsInternetStream</visible>
                    </control>
                    <control type="image">
                       <left>15</left>
                        <bottom>5</bottom>
                        <width>405</width>
                        <height>405</height>
                        <aspectratio aligny="bottom" align="center">keep</aspectratio>
                        <texture background="true" fallback="DefaultAudio.png">$INFO[Window(Visualisation).Property(srh.AlbumCover)]</texture>
                        <bordersize>20</bordersize>
                        <visible>Player.HasAudio + Window.IsVisible(MusicVisualisation.xml) + Player.IsInternetStream</visible>
                    </control>
The top control is displayed if we are not playing any radio from somewhere but we are in the music visualisation screen and we are playing some audio.  The second is displayed if we are streaming from the internet.  Both controls are in the same place in the window, we just decide which to show based on whether or not the audio playing is coming from the internet or not.

Hope that helps a bit.
Learning Linux the hard way !!
Reply
#6
(2019-09-29, 11:50)black_eagle Wrote: To get it run when you switch to the music OSD you need to add
xml:
<onload condition="System.HasAddon(script.radio.streaming.helper)">RunScript(script.radio.streaming.helper)</onload>
to MusicVisualisation.xml

It needs to be inside the <window> tag at the top of the file.  eg

xml:
<?xml version="1.0" encoding="utf-8"?>
<window>
    <onload condition="System.HasAddon(script.radio.streaming.helper)">RunScript(script.radio.streaming.helper)</onload>
    <onload condition="System.HasAddon(script.artistslideshow)">RunScript(script.artistslideshow)</onload>
 
    <defaultcontrol></defaultcontrol>
    <backgroundcolor>background</backgroundcolor>
    <controls>
I have this in MusicVisualisation.xml:

<?xml version="1.0" encoding="UTF-8"?>
<window>
    <defaultcontrol></defaultcontrol>
    <onload>ActivateWindow(MusicOSD)</onload>
    <onload>RunScript(script.radio.streaming.helper)</onload>
    <onunload>ClearProperty(PopupMenuVisible,Home)</onunload>
    <controls>


so this should be OK even though the check for the presence of the add-on should be added (the line I've inserted that doesn't have it comes directly from your README.md, maybe this deserves a change)

I'll try putting the RunScript line before the ActivateWindow.
(2019-09-29, 11:50)black_eagle Wrote: You'll need to point it to your music library in the addon settings, else it will keep asking for the location.
 
I don't have any local music library, as I get everything either from online streams (without a PVR backend AFAIK, I'm using the Radio add-on) or from my UPnP server. What am I supposed to enter there?
(2019-09-29, 11:50)black_eagle Wrote:
(2019-09-29, 09:17)sba923 Wrote: Next to that, further down the line I will need to be able to detect whether MusicOSD.xml (more specifically, PlayerControlCommons in IncludesPlayerControls.xml) is used for streaming radio / the properties you're adding do exist as opposed to other uses (e.g. my UPnP use case) so that the standard properties e.g. $INFO[MusicPlayer.Artist] are used instead of yours e.g. $INFO[Window(12006).Property(srh.Artist)]. Can you help me out with that? For instance, is there a "if exist" mechanism that can be used in skin XML code?

I'm not totally clear on what you're asking here but if it's what I think it is, you can use the <visible> tag to show or hide the extra properties depending on whether the currently playing file is a stream or a local track.

For example, <visible>!Pvr.IsPlayingRadio + !Player.IsInternetStream</visible> will only show that control for a locally playing track.  If either of those conditions are true (so Kodi is playing either a stream or a radio station from a pvr backend) then it won't be shown.

You can also use !StringIsEmpty(Window(Visualisation).Property(srh.SomeProperty)) to determine whether or not that particular property contains a value and then show or hide the control accordingly.


xml:
<control type="image">
                        <depth>DepthOSD+</depth>
                        <left>15</left>
                        <bottom>5</bottom>
                        <width>405</width>
                        <height>405</height>
                        <aspectratio aligny="bottom" align="center">keep</aspectratio>
                        <texture background="true" fallback="DefaultAudio.png">$VAR[MusicPlayerCover]</texture>
                        <bordersize>20</bordersize>
                        <visible>Player.HasAudio + Window.IsVisible(MusicVisualisation.xml) + !Pvr.IsPlayingRadio + !Player.IsInternetStream</visible>
                    </control>
                    <control type="image">
                       <left>15</left>
                        <bottom>5</bottom>
                        <width>405</width>
                        <height>405</height>
                        <aspectratio aligny="bottom" align="center">keep</aspectratio>
                        <texture background="true" fallback="DefaultAudio.png">$INFO[Window(Visualisation).Property(srh.AlbumCover)]</texture>
                        <bordersize>20</bordersize>
                        <visible>Player.HasAudio + Window.IsVisible(MusicVisualisation.xml) + Player.IsInternetStream</visible>
                    </control>
The top control is displayed if we are not playing any radio from somewhere but we are in the music visualisation screen and we are playing some audio.  The second is displayed if we are streaming from the internet.  Both controls are in the same place in the window, we just decide which to show based on whether or not the audio playing is coming from the internet or not.

Hope that helps a bit.  
The controls I'm using in my modified Estouchy are defined in IncludePlayersControl.xml, included from MusicOSD.xml (and from VideoOSD.xml that I don't use at this point) and are used in all situations, so in my case: online radio (via the Radio add-on) and UPnP source.

                <control type="label">
                    <posx>250</posx>
                    <posy>-100</posy>
                    <width>1000</width>
                    <height>25</height>
                    <align>left</align>
                    <font>font25</font>
                    <label>$VAR[OSDLabel1]</label>
                    <scroll>true</scroll>
                </control>
                <control type="label">
                    <posx>280</posx>
                    <posy>0</posy>
                    <width>1000</width>
                    <height>30</height>
                    <font>font30_title</font>
                    <align>left</align>
                    <aligny>center</aligny>
                    <label>$VAR[OSDLabel2]</label>
                    <scroll>true</scroll>
                </control>
                <control type="label">
                    <posx>250</posx>
                    <posy>55</posy>
                    <width>1000</width>
                    <height>25</height>
                    <align>left</align>
                    <font>font24</font>
                    <label>$VAR[OSDLabel3]</label>
                    <scroll>true</scroll>
                </control>


The variables are defined in Includes.xml:

    <variable name="OSDLabel1">
        <value condition="Window.IsVisible(MusicOSD)">$INFO[MusicPlayer.Artist]</value>
        <value condition="Window.IsVisible(VideoOSD) + VideoPlayer.Content(Episodes)">$INFO[VideoPlayer.TVShowTitle]</value>
        <value condition="Window.IsVisible(VideoOSD)">$INFO[VideoPlayer.Studio]</value>
    </variable>
    <variable name="OSDLabel2">
        <value condition="Window.IsVisible(MusicOSD)">$INFO[MusicPlayer.Title]</value>
        <value condition="Window.IsVisible(VideoOSD)">$INFO[VideoPlayer.Title]</value>
    </variable>
    <variable name="OSDLabel3">
        <value condition="Window.IsVisible(MusicOSD)">$INFO[MusicPlayer.Album]</value>
        <value condition="Window.IsVisible(VideoOSD) + VideoPlayer.Content(Episodes)">$INFO[VideoPlayer.Season,$LOCALIZE[20373]: ]   $INFO[VideoPlayer.Episode,$LOCALIZE[20359]: ]</value>
        <value condition="Window.IsVisible(VideoOSD)">$INFO[VideoPlayer.Genre]</value>
    </variable>


What I want is that the contents of these variables depends on whether the context is "radio" (in which case I would get the values from your add-on's properties) or "other" (in which case the values would be as currently defined). The controls need to always be visible.

About the format of the "track string": I've found another radio (Jazz24) where yet another format is used:

<artist> - <title>

which is the exact opposite order from what you have implemented.

This makes me think that we need a mechanism to configure, on a per-station basis, how the "track string" should be parsed...
Reply
#7
K, a lot of stuff there to answer !! 

Right, you can configure the addon to reverse the order of track - artist in the settings on a per-station basis but you have to set a 'pretty' display name for the station for it to work. You can also configure it to strip non-needed text from the string if you so require.

Image

No local library.  Hmmm, I honestly didn't allow for this as the local library is the first place the addon looks for art.  However, if you just set it to some arbitrary location it won't find any art and will automatically fall back to looking stuff up on the internet, using fanart.tv, theaudiodb (where it gets most of its stuff from) and last.fm  .

 
(2019-09-29, 13:19)sba923 Wrote: <variable name="OSDLabel1">
        <value condition="Window.IsVisible(MusicOSD)">$INFO[MusicPlayer.Artist]</value>

So, you need to use conditions to determine which value goes into the variable.

xml:
<variable name="MusicPlayerDiscTitleVar">
<value condition="Pvr.IsPlayingRadio">$INFO[VideoPlayer.ChannelName]</value>
<value condition="!String.IsEmpty(MusicPlayer.Artist)">$INFO[MusicPlayer.Artist]</value>
<value condition="!String.IsEmpty(Window(Visualisation).Property(srh.Artist))">$INFO[Window(Visualisation).Property(srh.Artist)]</value>
<value>$INFO[MusicPlayer.Title]</value>
</variable>

So here we use VideoPlayer.ChannelName if we are playing a PVR radio station, MusicPlayer.Artist if it contains a value, srh.Artist if that contains a value and if all of those fail we fall back to Musicplayer.Title. Those get processed in order, top to bottom and the first one that meets the condition gets set. For streaming stuff, its very unlikely that Kodi core has a value for musicplayer.artist so that string will be empty and we check the next condition (NOT StringIsEmpty(blah blah blah) which if it contains a value will meet the condition and the variable will be set with the contents of srh.Artist
Learning Linux the hard way !!
Reply
#8
(2019-09-28, 20:27)sba923 Wrote: Hi,

Sorry if this is dumb question, I'm still a Kodi beginner, even though I'm already into skinning  Wink

I only get "placeholder" (music notes) thumbnails when I'm browsing for songs / listening to music, be it radio stations via the Radio add-on, or songs pulled off my UPnP server (TwonkyServer).

What am I missing to get the album art in place of these placeholders?

On the UPnP side of the equation, shouldn't Kodi pull the icon from the server?

On the radio side of the equation, is there a means to have Kodi get the icon from some online provider, based on artist / album or artist / song title?

Thanks a lot in advance for your help.

Does anyone have an idea about the UPnP side of the equation?

My TwonkyServer's configuration does specify to return album art to the UPnP client:

            <container name='artist' id='music/artists' class='object.container' createClass='object.item.audioItem.musicTrack'>
                <container buildon='upnp:artist[7]' class='object.container' createClass='object.item.audioItem.musicTrack'>
                    <container buildon='upnp:artist[2]' class='object.container.person.musicArtist' createClass='object.item.audioItem.musicTrack'>
                        <container buildon='upnp:artist' class='object.container.person.musicArtist' createClass='object.item.audioItem.musicTrack'>
                            <container name='allname' createClass='object.item.audioItem.musicTrack' class='object.container' />
                            <container buildon='upnp:album' albumart='1' sortcriteria='+pv:numberOfThisDisc,+upnp:originalTrackNumber' createClass='object.item.audioItem.musicTrack' class='object.container.album.musicAlbum' /></container>
                    </container>
Reply

Logout Mark Read Team Forum Stats Members Help
No album art thumbnails0