dev day #100 - WE ARE FUCKING DONE, hotfixes incoming but we did it in 100 days, lets fucking go guys, anyone reading this...i love you

This commit is contained in:
Tomas Dvorak
2025-11-22 21:30:10 +01:00
parent f5b6f83974
commit aa036b6550
47 changed files with 3607 additions and 2177 deletions
@@ -1,5 +1,6 @@
import React, { useEffect, useState } from 'react';
import { API_URL } from '../../services/api';
import { getZoneramaManifestWithFallbacks } from '../../services/zonerama';
import { Link as RouterLink } from 'react-router-dom';
import {
Box,
@@ -93,6 +94,29 @@ const GallerySection: React.FC<{ zoneramaUrl?: string | null }> = ({ zoneramaUrl
combinedAlbums = [...combinedAlbums, ...validBlogAlbums];
}
// Fallback: synthesize albums from manifest/picks when both sources are empty or invalid
if ((!combinedAlbums || combinedAlbums.length === 0)) {
try {
const items = await getZoneramaManifestWithFallbacks();
if (Array.isArray(items) && items.length > 0) {
const byAlbum: Record<string, typeof items> = {} as any;
items.forEach((it) => {
const aid = String(it.album_id || 'unknown');
(byAlbum[aid] = byAlbum[aid] || []).push(it);
});
const synthesized: Album[] = Object.entries(byAlbum).map(([aid, arr]) => ({
id: aid,
title: 'Album',
url: (arr[0] as any).page_url || '#',
date: '',
photos_count: arr.length,
photos: arr.slice(0, 12).map((p: any) => ({ id: String(p.id || ''), page_url: String(p.page_url || ''), image_1500: String(p.src || p.local || '') })),
}));
combinedAlbums = synthesized;
}
} catch {}
}
// Sort by date (newest first)
combinedAlbums.sort((a, b) => {