Merge branch 'fix/249-unbounded-growth' into batch/248-249
Both branches add to the same two registries, so the conflicts are between the two fixes rather than with main: - backend/app.go: both register a janitor job. Both are registered. - backend/maintenance/sweeps.go: both append a job at the end of the file. Both are kept, each with its own closing tail. - backend/maintenance/maintenance_test.go: both append a test. Both are kept as separate functions. - backend/library/library.go: #249's orphan-path lyrics delete was written against the loop variable before #250 renamed it, so its `audioFile.ID` no longer exists in that function. Adapted to `f.ID`. Closes #248 Closes #249
This commit is contained in:
@@ -1034,7 +1034,7 @@ func (l *Library) scanInternal(
|
||||
}
|
||||
}
|
||||
|
||||
// Remove from FTS5 search index.
|
||||
// Remove from FTS5 search index and the lyrics index.
|
||||
if err := l.db.DeleteSearchIndex(f.ID); err != nil {
|
||||
l.logger.Warn(
|
||||
"failed to delete FTS entry for orphan",
|
||||
@@ -1045,6 +1045,16 @@ func (l *Library) scanInternal(
|
||||
metrics.addWarning(path, "orphan", err)
|
||||
}
|
||||
|
||||
if err := l.db.DeleteLyricsIndex(f.ID); err != nil {
|
||||
l.logger.Warn(
|
||||
"failed to delete lyrics index entry for orphan",
|
||||
"id", f.ID,
|
||||
"err", err,
|
||||
)
|
||||
|
||||
metrics.addWarning(path, "orphan", err)
|
||||
}
|
||||
|
||||
removed.Add(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user