MMM-Sonos icon indicating copy to clipboard operation
MMM-Sonos copied to clipboard

Album art not showing

Open gmglickman opened this issue 7 years ago • 8 comments

Everything else works, but I'm seeing only a generic icon where the album art should be. Except during commercial, then the graphic appears. Has anyone seen this?

gmglickman avatar Jan 24 '18 15:01 gmglickman

Did it ever work correct? Is the album art also missing if you tune into a radio station?

CFenner avatar Jan 24 '18 21:01 CFenner

radio station album art works for me. still get name of station , and then second line which is bbc.media.radio2_mf_p?s=1517844460&.....

dinkybluebug avatar Feb 05 '18 18:02 dinkybluebug

@gmglickman can you query the sonos api and post the results here?

CFenner avatar Feb 05 '18 20:02 CFenner

See https://github.com/jishi/node-sonos-http-api/issues/673 I have a pull request in that mitigates this: https://github.com/CFenner/MMM-Sonos/pull/28

hdurdle avatar Jul 05 '19 17:07 hdurdle

Is there any update on this issue?

I know the problem is the url for absoluteAlbumArtUri is relative, and doesn't include the full url when playing tracks from a local network media library, giving a broken album cover image. The /getaa?... image url won't work locally, but will if you give it a full url with any Sonos player's network ip.

I'm aware of the #28 pull request by @hdurdle which adds the artBase config to put in that needed Sonos ip, but that code doesn't work for me. It returns a "Uncaught (in promise) TypeError: cover is undefined" error. That pull request is still marked Open and needing branch conflicts resolved.

jca2112 avatar Oct 05 '23 16:10 jca2112

Ive updated my MMM-Sonos.js in the follwoing way (only the section update Room List all the way to the clean section)

Works for me ...

  updateRoomList: function (data) {
    const roomList = []
    data.forEach(function (item) {
      const roomName = this.getRoomName(item)
      if (roomName !== '') {
        const currentTrack = item.coordinator.state.currentTrack
        //Extract http from absoluteAlbumArtUri - might be required later
        let baseUrl = currentTrack.absoluteAlbumArtUri.split('/').slice(0, 3).join('/');
        let artist = currentTrack.artist
        let track = currentTrack.title
        // Get cover from albumArtUri - could be http or /getaa Version
        let cover = currentTrack.albumArtUri
        // Check what we got from albumArtUri and either add baseUrl or leave it 
        if (!cover.startsWith("http")) {
                // If not, prepend the base URL
                cover = baseUrl + cover;
            }
        //let cover = currentTrack.absoluteAlbumArtUri
        //        var streamInfo = currentTrack.streamInfo;
        //        var type = currentTrack.type;

        // clean data

Thorn2910 avatar Feb 25 '24 08:02 Thorn2910

Great, could you change that in the repository and create a pull request? I currently have no working setup to test this.

CFenner avatar Feb 25 '24 09:02 CFenner

Just created pull request 97 - hope this helps

Thorn2910 avatar Feb 25 '24 16:02 Thorn2910