fix: xREL leere Cache-Einträge bei manuellem Suchen ignorieren, Titel als Query-Params

This commit is contained in:
2026-06-11 02:01:35 +02:00
parent 26059556ac
commit 9076fbcc0b
2 changed files with 30 additions and 11 deletions

View File

@@ -456,10 +456,16 @@ function MovieModal({ tmdbId, onClose, mobile, onHasXrel }) {
}, [tmdbId]);
const searchXrel = async (refresh = false) => {
if (!detail) return;
setXrelLoading(true);
try {
const url = `/tools/media/movie/${tmdbId}/xrel${refresh ? '?refresh=1' : ''}`;
const d = await api(url);
const params = new URLSearchParams({
title: detail.title || '',
orig: detail.original_title || '',
imdb_id: detail.imdb_id || '',
});
if (refresh) params.set('refresh', '1');
const d = await api(`/tools/media/movie/${tmdbId}/xrel?${params}`);
setXrel(d.xrel || []);
if (d.has_xrel) onHasXrel?.(tmdbId);
} catch(_) { setXrel([]); }