Skip to content

The open-source AI voice studio. Clone, dictate, create.

handle null duration in story_items migration

James Pine69486c2a77a0
diff --git a/backend/database/migrations.py b/backend/database/migrations.py
index 158b38c6..52757a68 100644
--- a/backend/database/migrations.py
+++ b/backend/database/migrations.py
@@ -82,7 +82,7 @@ def _migrate_story_items(engine, inspector, tables: set[str]) -> None:
text("UPDATE story_items SET start_time_ms = :time WHERE id = :id"),
{"time": current_time_ms, "id": item_id},
)
- current_time_ms += int(duration * 1000) + 200
+ current_time_ms += int((duration or 0) * 1000) + 200
conn.commit()
# Recreate table without the position column (SQLite lacks DROP COLUMN)