%
function extension(string) {
return string.slice((string.lastIndexOf(".") - 2 >>> 0) + 2);
}
const videoExtensions = ['.mp4', '.mov', '.avi', '.flv', '.mkv', '.wmv', '.webm'];
const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.tiff', '.webp'];
%>
<% files.forEach(function(file) { %>
<% if (videoExtensions.includes(extension(file.path))) { %>
Optimizing Video for Sharing...
<% if(user.username == "admin" && file.username != "admin") { %>
<%= file.username %>
<% } %>
Copy as GIFv
<% } else if (extension(file.path) == ".gif") { %>
<% if(user.username == "admin" && file.username != "admin") { %>
<%= file.username %>
<% } %>
Copy as GIFv
<% } else if (imageExtensions.includes(extension(file.path))) { %>

<% if(user.username == "admin" && file.username != "admin") { %>
<%= file.username %>
<% } %>
<% } else {%>
<% } %>
<% }); %>