diff --git a/modules/stuff.js b/modules/stuff.js index d890ac2..8b95381 100644 --- a/modules/stuff.js +++ b/modules/stuff.js @@ -96,7 +96,8 @@ function appGetFileType (app, wildcard, contentType, pageToRender) { path: p, fname, url, - contentType + contentType, + albumArt: GetAlbumArt(p) }) } }) @@ -108,6 +109,15 @@ const fileTypes = [ ['/*.zip', 'application/zip'] ] +function GetAlbumArt (path) { + let tmp = path.split('.') + tmp.pop() + tmp = tmp.join('.').split('/') + let last = tmp.pop() + + return tmp.join('/') + '/.' + last + '.png' +} + fileTypes.forEach((t) => { appGetFileType(app, t[0], t[1], t[2]) }) diff --git a/views/stuff/audio.ejs b/views/stuff/audio.ejs index 30678ef..297ff6c 100644 --- a/views/stuff/audio.ejs +++ b/views/stuff/audio.ejs @@ -21,6 +21,11 @@