fix(daemon): use canonical movie states in import
ci / web (push) Successful in 57s
ci / rust (push) Successful in 1m45s
e2e / e2e (push) Successful in 1m48s

PRs #82 and #85 were each green pre-merge; #85 renamed movie states
(grabbed->downloading, imported->available) and #82's import path
still wrote the old names, so main failed the movies CHECK constraint.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-08-22 23:23:56 +01:00
parent ffb8485939
commit 0343783a57
3 changed files with 16 additions and 16 deletions
+4 -4
View File
@@ -405,7 +405,7 @@ async fn record_import(
.await?;
sqlx::query!(
"UPDATE movies
SET state = 'imported',
SET state = 'available',
updated_at = strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
WHERE id = ?",
pending.movie_id
@@ -633,7 +633,7 @@ mod tests {
.unwrap();
sqlx::query(
"INSERT INTO movies (tmdb_id, title, year, original_language, root_id, state)
SELECT 693134, 'Dune: Part Two', 2024, 'en', id, 'grabbed'
SELECT 693134, 'Dune: Part Two', 2024, 'en', id, 'downloading'
FROM roots WHERE kind = 'movie' AND audience = 'main'",
)
.execute(database.pool())
@@ -728,7 +728,7 @@ mod tests {
.fetch_one(h.database.pool())
.await
.unwrap();
assert_eq!(movie_state, "imported");
assert_eq!(movie_state, "available");
}
/// §5.3 through §5.7: Profile 5 is a hard fail — blacklisted, grab
@@ -786,7 +786,7 @@ mod tests {
.execute(h.database.pool())
.await
.unwrap();
sqlx::query("UPDATE movies SET state = 'grabbed'")
sqlx::query("UPDATE movies SET state = 'downloading'")
.execute(h.database.pool())
.await
.unwrap();