diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js index 86e6ffa371..64a6fb96bb 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js @@ -818,6 +818,16 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo lines.push(item.ProductionYear || ''); } + if (options.showRuntime) { + + if (item.RunTimeTicks) { + + lines.push(datetime.getDisplayRunningTime(item.RunTimeTicks)); + } else { + lines.push(''); + } + } + if (options.showChannelName) { lines.push(item.ChannelName || ''); diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 30c1eb6066..06abd20a17 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1807,73 +1807,15 @@ function getVideosHtml(items, user, limit, moreButtonClass) { - var html = ''; - - for (var i = 0, length = items.length; i < length; i++) { - - if (limit && i >= limit) { - break; - } - - var item = items[i]; - - var cssClass = "card backdropCard scalableCard backdropCard-scalable"; - - var href = "itemdetails.html?id=" + item.Id; - - var onclick = item.PlayAccess == 'Full' ? ' onclick="MediaController.play(\'' + item.Id + '\'); return false;"' : ""; - - html += ''; - - html += '
'; - html += '
'; - - var imageTags = item.ImageTags || {}; - - var imgUrl; - - if (imageTags.Primary) { - - imgUrl = ApiClient.getScaledImageUrl(item.Id, { - maxWidth: 400, - tag: imageTags.Primary, - type: "primary" - }); - - } else { - imgUrl = "css/images/items/detail/video.png"; - } - - html += '
'; - - html += '
'; - html += '
'; - - html += '
'; - html += '
' + item.Name + '
'; - html += '
'; - if (item.RunTimeTicks != "") { - html += datetime.getDisplayRunningTime(item.RunTimeTicks); - } - else { - html += " "; - } - html += '
'; - - //cardFooter - html += "
"; - - // cardContent - html += '
'; - - // cardScalable - html += '
'; - - // cardBox - html += '
'; - - html += '
'; - } + var html = cardBuilder.getCardsHtml({ + items: items, + shape: "backdrop", + preferThumb: true, + showTitle: true, + action: 'play', + overlayText: true, + showRuntime: true + }); if (limit && items.length > limit) { html += '

';