Browse Source

Updated table to display icons of videos.

pull/6/head
jrtechs 5 years ago
parent
commit
619c69e227
2 changed files with 6 additions and 6 deletions
  1. +2
    -2
      html/videos.html
  2. +4
    -4
      server.js

+ 2
- 2
html/videos.html View File

@ -5,7 +5,7 @@
<thead class="thead-dark">
<tr>
<td>Name</td>
<td>Length</td>
<td>Icon</td>
<td>Watch</td>
</tr>
</thead>
@ -13,7 +13,7 @@
{for video in videos}
<tr class="table_row">
<td>{video.name}</td>
<td>{video.length}</td>
<td><img src="/icon?v={video.name}" alt="Icon for {video.name}" height = 60px/></td>
<td>
<a href="/watch?v={video.name}" class="btn btn-secondary active" role="button" aria-pressed="true">View</a>
</td>

+ 4
- 4
server.js View File

@ -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"});

Loading…
Cancel
Save