fix: database migration

This commit is contained in:
2026-04-05 12:47:58 +02:00
parent e0c0c8a31e
commit c7a939736c
59 changed files with 766 additions and 306 deletions

View File

@@ -444,20 +444,13 @@ pub fn rebuild_media_from_filesystem_with_progress(
/// Index a media item in FTS, gathering translation texts.
fn fts_index_media(conn: &Connection, media: &Media) -> EngineResult<()> {
let translations = qmt::list_media_translations_by_media(conn, &media.id).unwrap_or_default();
let translation_data: Vec<(String, String)> = translations
let translation_data: Vec<fts::MediaTranslationFts> = translations
.iter()
.map(|t| {
let mut parts = Vec::new();
if let Some(ref title) = t.title {
parts.push(title.clone());
}
if let Some(ref alt) = t.alt {
parts.push(alt.clone());
}
if let Some(ref caption) = t.caption {
parts.push(caption.clone());
}
(parts.join(" "), t.language.clone())
.map(|t| fts::MediaTranslationFts {
title: t.title.clone(),
alt: t.alt.clone(),
caption: t.caption.clone(),
language: t.language.clone(),
})
.collect();