Update image links and add artist information to gallery

Updates image URLs in gallery-data.json and adds 'Folx Stadl' artist mapping for folders 2-6, resolving display issues and completing artist information for all gallery images.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: e56aef2e-3931-4b9f-993c-7ddb5da708b6
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/jdAEdU5
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sebastjanartic 2026-03-04 09:11:17 +00:00
parent b5c7bd2d86
commit 5ba9717fec
3 changed files with 543 additions and 528 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because it is too large Load Diff

View File

@ -341,6 +341,14 @@ export async function registerRoutes(
});
// Gallery API - serves shuffled photos from Dropbox
const folderArtists: Record<string, string> = {
"2": "Folx Stadl",
"3": "Folx Stadl",
"4": "Folx Stadl",
"5": "Folx Stadl",
"6": "Folx Stadl",
};
app.get("/api/gallery", async (_req, res) => {
try {
let data: any[] = [];
@ -354,6 +362,13 @@ export async function registerRoutes(
data = JSON.parse(fs.readFileSync(galleryPath, "utf-8"));
}
data = data.map((img: any) => {
if (!img.artist && folderArtists[img.folder]) {
return { ...img, artist: folderArtists[img.folder] };
}
return img;
});
const shuffled = [...data];
for (let i = shuffled.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));