custom-cards / upcoming-media-card

📺 A card to display upcoming episodes and movies from services like: Plex, Kodi, Radarr, Sonarr, and Trakt.
281 stars 79 forks source link

[Feature Request] Show only Poster with no text to side #55

Closed atomicpapa closed 4 years ago

atomicpapa commented 4 years ago

Would it be possible to have the card ONLY show the poster (or potentially fanart)? Currently I can set all text entities to empty but that only results in image Whereas, I would like for it to only show image

maykar commented 4 years ago

This isn't something that I would add, but you can create something like this on your own pretty easily. All the components I made for this card return JSON that can be used elsewhere (and any that I didn't make may as well, or should), using that data you can really make anything you want with a bit of jinja.

Here's an HA markdown card using the just the images from the first 4 episodes from plex_recently_added (change "poster" to "fanart" if you'd rather have that):

      - type: markdown
        content: >
          ![]({{ state_attr('sensor.plex_recently_added', 'data')[1]["poster"]}})

          ![]({{ state_attr('sensor.plex_recently_added', 'data')[2]["poster"]}})

          ![]({{ state_attr('sensor.plex_recently_added', 'data')[3]["poster"]}})

          ![]({{ state_attr('sensor.plex_recently_added', 'data')[4]["poster"]}})

If any component you're using for this card doesn't return usable JSON like this, you should add it as a feature request on the components repo.

maykar commented 3 years ago

Someone on the forums just asked a similar question and I thought I would share an updated markdown card that I used for them. This one uses a for loop to iterate over every item:

type: markdown
content: |-
  {% for item in state_attr('sensor.plex_recently_added', 'data') %}
    {% if item.poster %} ![]({{ item.poster }}) {% endif %}
  {% endfor %}