Album art for audio

This commit is contained in:
MrFry 2019-11-10 15:25:33 +01:00
parent 227fa36e6c
commit 3a7818b403
2 changed files with 16 additions and 1 deletions

View file

@ -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])
})