From 5fb2584525f1772b9c90ce5e671507fa0bc748b7 Mon Sep 17 00:00:00 2001 From: Ashley //// Date: Thu, 1 Feb 2024 11:28:44 +0000 Subject: [PATCH] fix stuff and add channel --- html/poketube.ejs | 58 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 7 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index 1f999806..823f3f57 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -1579,8 +1579,10 @@ display: block; !important;" autoplay controls> - + <% if (inv_vid.recommendedVideos.length > 1) { %> +
+
Recommended Videos
@@ -1589,18 +1591,27 @@ Recommended Videos Visit <%=k.Video.Channel.Name%>'s channel -
+ + + + <% } %> + <% if (!r) { %> + <% if (inv_vid.recommendedVideos.length > 1) { %>
- + <% } %> + <% if (!f) { %> + +<% if (inv_vid.recommendedVideos) { %> + <% inv_vid?.recommendedVideos.forEach(x => { %>
<% if (!optout) { %><%- turntomins(x.lengthSeconds) || "LIVE"%><% } %><% if (optout) { %><%- x.duration || "LIVE"%><% } %> @@ -1628,8 +1639,41 @@ Recommended Videos
<% }) %> + + <% } %> - + <% } %> + + <% if (inv_vid.recommendedVideos.length < 1) { %> + <% channel_uploads.latestVideos.forEach(x => { %> +
+ <% if (!optout) { %><%- turntomins(x.lengthSeconds) || "LIVE"%><% } %><% if (optout) { %><%- x.duration || "LIVE"%><% } %> +
+ <% if (!optout) { %> + + <%= x.title %> + + <% } %> + <% if (optout) { %> + + <%= x.title %> + + <% } %> +
+ + <%=x.author %> + +
+ + <%= convert(x.viewCount) %> views + +
+
+
+
+ <% }) %> + <% } %> + <% if (f) { %> <% tj.forEach(x => { %> @@ -1730,7 +1774,7 @@ Recommended Videos } - <% if (inv_vid?.recommendedVideos) { %> + <% if (Array.isArray(inv_vid.recommendedVideos) && inv_vid.recommendedVideos.length > 1) { %> let checkbox = document.getElementById("continue"); @@ -1738,10 +1782,10 @@ checkbox.addEventListener('change', function(e) { if (checkbox.checked) { console.log("[AUTOPLAY] enabled"); document.getElementById('video').addEventListener('ended', autoplaynextvideo, false); - let url = window.location.hostname + "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId %>"; + let url = window.location.hostname + "/watch?v=<%- inv_vid?.recommendedVideos[0]?.videoId %>"; function autoplaynextvideo(e) { - location.href = "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + inv_vid?.recommendedVideos[0].videoId) %>"; + location.href = "/watch?v=<%- inv_vid?.recommendedVideos[0]?.videoId%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + inv_vid?.recommendedVideos[0].videoId) %>"; } } if (/[?&]autoplay=/.test(location.search)) {