iantrich / list-card

📰 Display sensor list data in a table
Apache License 2.0
123 stars 34 forks source link

How to ADD image? #29

Closed NinDTendo closed 3 years ago

NinDTendo commented 3 years ago

The RSS feed of mine does not have images in items .

Is it possible to add images through lovelace?

RSS example:

<item>
   <title>[SubsPlease] Gochuumon wa Usagi Desu ka S3 - 06 (720p) [61498D46].mkv</title>
   <link>magnet:?xt=urn:btih:6DAUW25ROIGXYRR5H6F2V42WCIQAZM4A&dn=%5BSubsPlease%5D%20Gochuumon%20wa%20Usagi%20Desu%20ka%20S3%20-%2006%20%28720p%29%20%5B61498D46%5D.mkv&xl=771540651&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2F9.rarbg.to%3A2710%2Fannounce&tr=udp%3A%2F%2F9.rarbg.me%3A2710%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.internetwarriors.net%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.cyberia.is%3A6969%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker3.itzmx.com%3A6961%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker.tiny-vps.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fretracker.lanta-net.ru%3A2710%2Fannounce&tr=http%3A%2F%2Fopen.acgnxtracker.com%3A80%2Fannounce&tr=wss%3A%2F%2Ftracker.openwebtorrent.com</link>
   <guid isPermaLink="false">6DAUW25ROIGXYRR5H6F2V42WCIQAZM4A</guid>
   <pubDate>Sat, 14 Nov 2020 13:01:08 +0000</pubDate>
   <subsplease:size>735.8 MiB</subsplease:size>
</item>

My Lovelace entry:

- type: custom:list-card
  entity: sensor.subsplease_feed
  title: SubsPlease Release
  feed_attribute: entries
  columns:
      - title: ''
        field: title
         add_link: link
  row_limit: 27
  style:
      .: |
         ha-card {
              height: -webkit-fill-available;
         }
iantrich commented 3 years ago

A default image for each, sure, I guess. You'd probably have to update the python source of feedparser to insert a default or the list-card itself I guess. Not something I'm going to support though. Thanks.

aaamoeder commented 3 years ago

I've tried changing line 164 in list-card.js

from

card_content += `<img id="image" src="${url}" width="${image_width}" height="${image_height}">`;

to

card_content += `<img id="image" src="http://192.168.0.7:8123/local/nieuwsblad.jpg" width="${image_width}" height="${image_height}">`;

But it's still not loading even the local image (which I verified is working as it should).

I'm probably going about it all wrong though, coding experience is minimal.. if you can spare some time, please advise.. Thank you