♠♣♦♥
All checks were successful
Deploy App / build (push) Successful in 2m29s
Deploy App / deploy (push) Successful in 15s

This commit is contained in:
valere
2025-10-11 09:56:14 +02:00
parent 2135b0fec6
commit 4d424eee54
4 changed files with 33 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ export default eventHandler(async (event) => {
const urlPrefix = `https://files.erudi.fr/music`
let files = await fs.promises.readdir(dirPath)
files = files.filter((f) => !f.startsWith('.'))
files = files.filter((f) => !f.startsWith('.') && !f.endsWith('.jpg'))
const tracks = files.map((file, index) => {
const EXT_RE = /\.(mp3|flac|wav|opus)$/i
@@ -43,7 +43,7 @@ export default eventHandler(async (event) => {
const date = new Date(year, month - 1, day, hour)
const card = getCardFromDate(date)
const url = `${urlPrefix}/${encodeURIComponent(file)}`
const coverId = `${urlPrefix}/cover/${encodeURIComponent(file)}`
const coverId = `${urlPrefix}/${encodeURIComponent(file).replace(EXT_RE, '.jpg')}`
return {
id: Number(`${year}${index + 1}`),