feat: add configurable status mappings for metadata providers
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 6s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 6s
Add a status_mappings table to replace hardcoded provider status normalization. Users can now configure how provider statuses (e.g. "releasing", "finie") map to target statuses (e.g. "ongoing", "ended") via the Settings > Integrations page. - Migration 0038: status_mappings table with pre-seeded mappings - Migration 0039: re-normalize existing series_metadata.status values - API: CRUD endpoints for status mappings, DB-based normalize function - API: new GET /series/provider-statuses endpoint - Backoffice: StatusMappingsCard component with create target, assign, and delete capabilities - Fix all clippy warnings across the API crate - Fix missing OpenAPI schema refs (MetadataStats, ProviderCount) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -429,6 +429,28 @@ export async function getThumbnailStats() {
|
||||
return apiFetch<ThumbnailStats>("/settings/thumbnail/stats");
|
||||
}
|
||||
|
||||
// Status mappings
|
||||
export type StatusMappingDto = {
|
||||
id: string;
|
||||
provider_status: string;
|
||||
mapped_status: string;
|
||||
};
|
||||
|
||||
export async function fetchStatusMappings(): Promise<StatusMappingDto[]> {
|
||||
return apiFetch<StatusMappingDto[]>("/settings/status-mappings");
|
||||
}
|
||||
|
||||
export async function upsertStatusMapping(provider_status: string, mapped_status: string): Promise<StatusMappingDto> {
|
||||
return apiFetch<StatusMappingDto>("/settings/status-mappings", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ provider_status, mapped_status }),
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteStatusMapping(id: string): Promise<void> {
|
||||
await apiFetch<unknown>(`/settings/status-mappings/${id}`, { method: "DELETE" });
|
||||
}
|
||||
|
||||
export async function convertBook(bookId: string) {
|
||||
return apiFetch<IndexJobDto>(`/books/${bookId}/convert`, { method: "POST" });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user