From 619c69e2277c785a70e0617387ff830fdf3be3de Mon Sep 17 00:00:00 2001 From: jrtechs Date: Tue, 5 Feb 2019 21:11:06 -0500 Subject: [PATCH] Updated table to display icons of videos. --- html/videos.html | 4 ++-- server.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/html/videos.html b/html/videos.html index 5f1d90e..e90e048 100644 --- a/html/videos.html +++ b/html/videos.html @@ -5,7 +5,7 @@ Name - Length + Icon Watch @@ -13,7 +13,7 @@ {for video in videos} {video.name} - {video.length} + Icon for {video.name} View diff --git a/server.js b/server.js index 5270c79..d304fe2 100644 --- a/server.js +++ b/server.js @@ -105,14 +105,14 @@ function getVideosTemplateInformation(templateContext, request) { var splitArray = file.split('/'); var name = splitArray[splitArray.length -1]; - - if (!fs.existsSync('img/private/' + name + ".png")) + const icon = 'img/private/' + name + ".png"; + if (!fs.existsSync(icon)) { - filepreview.generate(file, 'img/private/' + name + ".png", function(error) { + filepreview.generate(file, icon, function(error) { if (error) { return console.log(error); } - console.log('File preview is located ' + 'img/private/' + file + ".png"); + console.log('File preview is located ' + icon); }); } videos.push({name: file.replace(rootDir, ''), length: "n/a"});