diff --git a/client/main.js b/client/main.js index 58fe4d8..c15c5f4 100644 --- a/client/main.js +++ b/client/main.js @@ -6,11 +6,15 @@ let db = await initDb(); let main = new Route([auth], async function (req, res, input) { let { username } = input; - let videos = await db.all('SELECT * FROM video ORDER BY date DESC LIMIT 10', [ + let videos = await db.all('SELECT * FROM video ORDER BY date DESC LIMIT 20', [ + ]); + let videosFollow = await db.all('SELECT * FROM video WHERE username IN (SELECT target FROM follow WHERE username = ?) ORDER BY date DESC LIMIT 20', [ + username ]); return res.render('main', { username, - videos + videos, + videosFollow }); }); diff --git a/views/main.ejs b/views/main.ejs index 1794cbf..bb7918d 100644 --- a/views/main.ejs +++ b/views/main.ejs @@ -18,6 +18,10 @@ <%- include ('guidelines.ejs') -%> +

Follow Feed

+
+ <%- include('videos.ejs', {videos: videosFollow}) -%> +

Recent Videos

<%- include('videos.ejs') -%>