fix: unmap status mappings instead of deleting, store unmapped provider statuses

- Make mapped_status nullable so unmapping (X button) sets NULL instead of
  deleting the row — provider statuses never disappear from the UI
- normalize_series_status now returns the raw provider status (lowercased)
  when no mapping exists, so all statuses are stored in series_metadata
- Fix series_statuses query crash caused by NULL mapped_status values
- Fix metadata batch/refresh server actions crashing page on 400 errors
- StatusMappingDto.mapped_status is now string | null in the backoffice

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-19 13:22:31 +01:00
parent d4c48de780
commit c44b51d6ef
11 changed files with 109 additions and 68 deletions

View File

@@ -870,7 +870,7 @@ pub async fn series_statuses(
r#"SELECT DISTINCT s FROM (
SELECT LOWER(status) AS s FROM series_metadata WHERE status IS NOT NULL
UNION
SELECT mapped_status AS s FROM status_mappings
SELECT mapped_status AS s FROM status_mappings WHERE mapped_status IS NOT NULL
) t ORDER BY s"#,
)
.fetch_all(&state.pool)