BUGFIX: FTS5 -- make sure only minimum updates happen

This commit is contained in:
Simon Martens
2026-01-10 23:36:10 +01:00
parent 57bbd68123
commit 4c2fcb991f
5 changed files with 79 additions and 20 deletions

View File

@@ -232,6 +232,11 @@ func HasScans(contents []*dbmodels.Content) bool {
}
func updateEntryFTS5(app core.App, entry *dbmodels.Entry) error {
// Always update contents for backward compatibility
return updateEntryFTS5WithContents(app, entry, true)
}
func updateEntryFTS5WithContents(app core.App, entry *dbmodels.Entry, updateContents bool) error {
if entry == nil {
return nil
}
@@ -267,6 +272,9 @@ func updateEntryFTS5(app core.App, entry *dbmodels.Entry) error {
}
}
// Update entry and all related contents
return dbmodels.UpdateFTS5EntryAndRelatedContents(app, entry, places, agents, series)
// Update entry and conditionally update related contents
if updateContents {
return dbmodels.UpdateFTS5EntryAndRelatedContents(app, entry, places, agents, series)
}
return dbmodels.UpdateFTS5Entry(app, entry, places, agents, series)
}