spotify-card icon indicating copy to clipboard operation
spotify-card copied to clipboard

Hide all Spotify connect devices turns playlists to gray scale

Open wkethman opened this issue 3 years ago • 3 comments

I found that Spotify Connect was inconsistent and so I am using the "Known Spotify Connect devices" to specify my devices. If you specify a known device and it automatically finds it without Hiding all Spotify connect devices there will be duplicates. However, if you use the Hide all Spotify connect devices it turns the playlist icons to grayscale. See below. I guess an issue that I am correcting with this method is the inconsistency of Spotify Connect to display my sources. All of my sources are either Amazon Alexa devices or Speaker Groups connected with Alexa Media Player. Screen Shot 2021-08-01 at 3 59 13 PM Screen Shot 2021-08-01 at 3 59 26 PM

wkethman avatar Aug 01 '21 21:08 wkethman

Right. Hmmm. If discovery of devices are buggy you should probably look that. I haven't got that much time nowadays for this card so hopefully someone can contribute to debugging and prepare a fix

fondberg avatar Aug 29 '21 14:08 fondberg

My feeling is, the known_spotify_connect_devices are not counted towards the devices in the DeviceList. I figure that from line 628 in spotify-card.ts https://github.com/custom-cards/spotify-card/blob/4297715dc23ff7331b1cc266ce8c2c7c09dd89bc/src/spotify-card.ts#L628

The count is then used to determine if the class .grey-scale is applied to the <div id="#content" ...> in line 505, which makes the covers go grey. https://github.com/custom-cards/spotify-card/blob/4297715dc23ff7331b1cc266ce8c2c7c09dd89bc/src/spotify-card.ts#L505

This actually also the problem behind #171 as the visibility configuration internally is modelled by emptying the devices list, again resulting in a count of zero, which makes the covers grey. https://github.com/custom-cards/spotify-card/blob/4297715dc23ff7331b1cc266ce8c2c7c09dd89bc/src/spotify-card.ts#L308

The question is, what the target state is supposed to be? I would assume, the covers are only grey, if there are no devices, known or not, independently of the view configuration. The solution would probably be to introduce a separate function to count the devices independent of the device list.

kongo09 avatar Jan 08 '22 22:01 kongo09

My quick fix is actually very simple using card_mod:

  card_mod:
    style: |
      div#content {
        filter: none;
      }

It won't solve the problem but it'll make the covers look pretty again.

kongo09 avatar Jan 08 '22 23:01 kongo09