fixing some database and adding issues

This commit is contained in:
Chris Cochrun 2025-10-04 13:59:36 -05:00
parent 7f30b4395f
commit 375cea2408
11 changed files with 709 additions and 392 deletions

View file

@ -310,7 +310,6 @@ pub async fn remove_from_db(
pub async fn add_presentation_to_db(
presentation: Presentation,
db: PoolConnection<Sqlite>,
id: i32,
) -> Result<()> {
let path = presentation
.path
@ -319,9 +318,8 @@ pub async fn add_presentation_to_db(
.unwrap_or_default();
let html = presentation.kind == PresKind::Html;
let mut db = db.detach();
let result = query!(
r#"INSERT into presentations VALUES($1, $2, $3, $4)"#,
id,
query!(
r#"INSERT INTO presentations (title, file_path, html) VALUES ($1, $2, $3)"#,
presentation.title,
path,
html,
@ -329,13 +327,6 @@ pub async fn add_presentation_to_db(
.execute(&mut db)
.await
.into_diagnostic()?;
if result.last_insert_rowid() != id as i64 {
let rowid = result.last_insert_rowid();
error!(
rowid,
id, "It appears that rowid and id aren't the same"
);
}
Ok(())
}