From a4c4a17bfba93076c76ba06e7630d2c675664422 Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Sun, 27 Apr 2025 10:56:13 +0200 Subject: [PATCH] Update hash removal pattern --- src/pages/tracks.astro | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/tracks.astro b/src/pages/tracks.astro index 963bf6e..3f24a01 100644 --- a/src/pages/tracks.astro +++ b/src/pages/tracks.astro @@ -7,10 +7,13 @@ const albumCovers = await Astro.glob("../content/album-covers/*"); const processedAlbumCovers = albumCovers.map((cover) => { const filePathWithoutParams = cover.default.src.split("?")[0]; - const filename = parse(filePathWithoutParams).name.replace( - /\.[a-zA-Z0-9]+$/, - "", - ); + + let filename = parse(filePathWithoutParams).name; + + const lastDotIndex = filename.lastIndexOf("."); + if (lastDotIndex !== -1) { + filename = filename.substring(0, lastDotIndex); + } const lastDashIndex = filename.lastIndexOf(" - "); const artists =