Update hash removal pattern

This commit is contained in:
thiloho
2025-04-27 10:56:13 +02:00
parent ee5ab23eb6
commit a4c4a17bfb

View File

@@ -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 =