mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2026-02-04 10:35:30 +00:00
BUGFIX: FTS5 -- make sure only minimum updates happen
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user