♠♣♦♥
This commit is contained in:
@@ -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}`),
|
||||
|
||||
Reference in New Issue
Block a user