feat: refresh metadata ciblé par série après import et dans la modale

- Après import torrent, refresh automatique des métadonnées uniquement
  sur la série importée (via refresh_link) au lieu d'un job complet
- Nouvel endpoint POST /metadata/refresh-link/:id pour rafraîchir un
  seul lien metadata approuvé
- Bouton "Rafraîchir" dans la modale metadata (état linked) avec
  spinner et confirmation visuelle

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 23:05:06 +01:00
parent 072d6870fe
commit ca17d02116
7 changed files with 120 additions and 6 deletions

View File

@@ -0,0 +1,13 @@
import { NextRequest, NextResponse } from "next/server";
import { apiFetch } from "@/lib/api";
export async function POST(_request: NextRequest, { params }: { params: Promise<{ id: string }> }) {
try {
const { id } = await params;
const data = await apiFetch(`/metadata/refresh-link/${id}`, { method: "POST" });
return NextResponse.json(data);
} catch (error) {
const message = error instanceof Error ? error.message : "Failed to refresh metadata";
return NextResponse.json({ error: message }, { status: 500 });
}
}