feat: add batch metadata jobs, series filters, and translate backoffice to French
- Add metadata_batch job type with background processing via tokio::spawn - Auto-apply metadata only when single result at 100% confidence - Support primary + fallback provider per library, "none" to opt out - Add batch report/results API endpoints and job detail UI - Add series_status and has_missing filters to both series listing pages - Add GET /series/statuses endpoint for dynamic filter options - Normalize series_metadata status values (migration 0036) - Hide ComicVine provider tab when no API key configured - Translate entire backoffice UI from English to French Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,9 @@ pub async fn cleanup_stale_jobs(pool: &PgPool) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Job types processed by the API, not the indexer.
|
||||
const API_ONLY_JOB_TYPES: &[&str] = &["metadata_batch"];
|
||||
|
||||
/// Job types that modify book/thumbnail data and must not run concurrently.
|
||||
const EXCLUSIVE_JOB_TYPES: &[&str] = &[
|
||||
"rebuild",
|
||||
@@ -75,6 +78,7 @@ pub async fn claim_next_job(pool: &PgPool) -> Result<Option<(Uuid, Option<Uuid>)
|
||||
SELECT j.id, j.type, j.library_id
|
||||
FROM index_jobs j
|
||||
WHERE j.status = 'pending'
|
||||
AND j.type != ALL($3)
|
||||
AND (
|
||||
-- Exclusive jobs: only if no other exclusive job is active
|
||||
(j.type = ANY($1) AND NOT $2::bool)
|
||||
@@ -96,6 +100,7 @@ pub async fn claim_next_job(pool: &PgPool) -> Result<Option<(Uuid, Option<Uuid>)
|
||||
)
|
||||
.bind(EXCLUSIVE_JOB_TYPES)
|
||||
.bind(has_active_exclusive)
|
||||
.bind(API_ONLY_JOB_TYPES)
|
||||
.fetch_optional(&mut *tx)
|
||||
.await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user