]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Avoid image container if there is no image
authorDavid Kalnischkies <david@kalnischkies.de>
Mon, 6 May 2024 15:08:57 +0000 (15:08 +0000)
committerFlole <Flole998@users.noreply.github.com>
Tue, 9 Sep 2025 18:31:51 +0000 (20:31 +0200)
src/webui/static/app/dvr.js

index d12094fe19999ef6e6522826b083acf84cdf1c72..12f412d18f0bac0dd165b66da0066d60607e7904 100644 (file)
@@ -97,13 +97,13 @@ tvheadend.dvrDetails = function(grid, index) {
             content += '<div class="x-epg-bottom">';
         }
         // If we have no image then use fanart image instead.
-        content += '<div class="x-epg-image-container">';
-        if (event.image != null && event.image.length > 0) {
-          content += '<img class="x-epg-image" src="' + event.image + '">';
-        } else if (event.fanart_image != null && event.fanart_image.length > 0) {
-          content += '<img class="x-epg-image" src="' + event.fanart_image + '">';
-        }
-        content += '</div>';
+        var eventimg = '';
+        if (event.image != null && event.image.length > 0)
+          eventimg = event.image;
+        else if (event.fanart_image != null && event.fanart_image.length > 0)
+          eventimg = event.fanart_image;
+        if (eventimg)
+          content += '<div class="x-epg-image-container"><img class="x-epg-image" src="' + eventimg + '"></div>';
 
         content += '<hr class="x-epg-hr"/>';
         if (event.disp_summary && (!event.disp_subtitle || event.disp_subtitle != event.disp_summary))