Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Album art not showing #21

Open
gmglickman opened this issue Jan 24, 2018 · 8 comments
Open

Album art not showing #21

gmglickman opened this issue Jan 24, 2018 · 8 comments

Comments

@gmglickman
Copy link

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?

@CFenner
Copy link
Owner

CFenner commented Jan 24, 2018

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

@dinkybluebug
Copy link

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&.....

@CFenner
Copy link
Owner

CFenner commented Feb 5, 2018

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

@hdurdle
Copy link

hdurdle commented Jul 5, 2019

See jishi/node-sonos-http-api#673
I have a pull request in that mitigates this: #28

@jca2112
Copy link

jca2112 commented Oct 5, 2023

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.

@Thorn2910
Copy link

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

@CFenner
Copy link
Owner

CFenner commented Feb 25, 2024

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

@Thorn2910
Copy link

Just created pull request 97 - hope this helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants