diff --git a/html/poketube.ejs b/html/poketube.ejs index 60429f75..870499ac 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -1376,6 +1376,17 @@ WIP! Date of upload: <%=date%> ^^

Rating : <%=engagement.rating.toLocaleString()%> (<%=engagement.dislikes.toLocaleString()%>/<%=engagement.likes.toLocaleString()%> LTDR)
+ + <% + const likes = parseInt(engagement.likes) || 0; + const dislikes = parseInt(engagement.dislikes) || 0; + const total = likes + dislikes; + + const likePercentage = total > 0 ? ((likes / total) * 100).toFixed(2) + '%' : '0%'; + const dislikePercentage = total > 0 ? ((dislikes / total) * 100).toFixed(2) + '%' : '0%'; + %> + + <%= likePercentage %> of the users lieked the video!! RYD date created : <%=engagement.dateCreated.toLocaleString()%>
See in json