<% const getMediaType = (filename) => { const ext = filename.slice(((filename.lastIndexOf(".") - 2) >>> 0) + 2).toLowerCase(); const videoExts = ['.mp4', '.mov', '.avi', '.flv', '.mkv', '.wmv', '.webm']; const imageExts = ['.jpg', '.jpeg', '.png', '.gif', '.bmp', '.svg', '.tiff', '.webp']; if (videoExts.includes(ext)) return 'video'; if (imageExts.includes(ext)) return 'image'; return 'other'; }; function sanitizeId(filename) { return filename.replace(/[^a-z0-9]/gi, '_'); } %> <% files.forEach(function(file) { %>
  • <% const mediaType = getMediaType(file.path); %> <% if (mediaType === 'video') { %>
    <% const sanitizedId = file.path.replace(/[^a-z0-9]/gi, '_'); %>
    Optimizing Video for Sharing...
    <% if(user.username === "admin" && file.username !== "admin") { %> <%= file.username %>
    <% } %> Copy as GIFv
    <% } else if (mediaType === 'image') { %>
    <% if(user.username === "admin" && file.username !== "admin") { %>
    <%= file.username %>
    <% } %>
    <% } else { %>

    <%= file.path.split('.').pop().toUpperCase() %> file

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