Add influence rework, image checkup, debug mode, and fetched paintings.
Support artist and movement influence links with web discovery, a developer checkup table with gallery/detail thumbnails, and debug image search with fix-it workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
0ece1195fa
commit
bf7db9b25e
@@ -46,6 +46,34 @@ export async function preloadArtistImages(artistId: number): Promise<{ fetched:
|
||||
return res.json();
|
||||
}
|
||||
|
||||
export interface DebugImageSearchResult {
|
||||
query: string;
|
||||
imageUrl: string | null;
|
||||
searchUrl: string;
|
||||
source: string;
|
||||
sourceLabel?: string;
|
||||
thumbUrl?: string;
|
||||
}
|
||||
|
||||
export interface PaintingCheckupRow {
|
||||
id: number;
|
||||
title: string;
|
||||
artist_name: string;
|
||||
year: number | null;
|
||||
gallery_file: string | null;
|
||||
gallery_preview: string | null;
|
||||
detail_file: string;
|
||||
detail_preview: string | null;
|
||||
detail_on_demand: boolean;
|
||||
gallery_file_exists: boolean;
|
||||
detail_file_exists: boolean | null;
|
||||
}
|
||||
|
||||
export interface PaintingCheckupData {
|
||||
paintings: PaintingCheckupRow[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export const api = {
|
||||
getBounds: () => fetchJson<YearBounds>(`${API}/bounds`),
|
||||
|
||||
@@ -66,4 +94,26 @@ export const api = {
|
||||
fetchJson<ArtistNavigation>(`${API}/artists/${id}/navigation`),
|
||||
|
||||
getPainting: (id: number) => fetchJson<PaintingDetail>(`${API}/paintings/${id}`),
|
||||
|
||||
getPaintingDebugImageSearch: (id: number) =>
|
||||
fetchJson<DebugImageSearchResult>(`${API}/paintings/${id}/debug-image-search`),
|
||||
|
||||
fixPaintingImage: (id: number, imageUrl: string) =>
|
||||
fetch(`${API}/paintings/${id}/fix-image`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ imageUrl }),
|
||||
}).then(async (res) => {
|
||||
if (!res.ok) {
|
||||
const body = await res.json().catch(() => ({}));
|
||||
throw new Error(body.error || `Fix failed: ${res.status}`);
|
||||
}
|
||||
return res.json() as Promise<{ imagePath: string; thumbnailPath: string }>;
|
||||
}),
|
||||
|
||||
getPaintingCheckup: () => fetchJson<PaintingCheckupData>(`${API}/paintings/checkup`),
|
||||
};
|
||||
|
||||
export function debugImageProxyUrl(imageUrl: string): string {
|
||||
return `${API}/debug/image-proxy?url=${encodeURIComponent(imageUrl)}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user