fix(search): empty folded queries, compatibility forms, final sigma, start-up log

- A search text that has nothing left once its accents are taken off matches
  nothing instead of everything.
- The search key folds compatibility forms (the ligature "fi", full-width
  letters) and the Greek final sigma.
- The start-up refresh of the keys logs when it starts and how long it took, since
  it can take a while on a big library the first time.
- More tests: a retitled track is found by its new title, a refresh fixes both
  keys and keeps "Beyoncé" and "Beyonce" apart, more cases for the key.
This commit is contained in:
tgiachi 2026-11-12 10:24:44 +01:00
commit 4ec3ae3bb0

View file

@ -125,9 +125,13 @@ func run() error {
gin.SetMode(gin.ReleaseMode)
}
libraryRepo := storage.NewLibraryRepo(db)
// On the first start after an upgrade that adds a key this can take a while on a big library.
logger.Info("refreshing the match keys of the library")
keysStarted := time.Now()
if err := libraryRepo.RefreshMatchKeys(ctx); err != nil {
return err
}
logger.Info("match keys are up to date", zap.Duration("took", time.Since(keysStarted)))
scanner := library.NewScanner(libraryRepo, library.TaglibReader{}, library.NewHub(), cfg.Library.ScanWorkers)
scans := library.NewManager(scanner, libraryRepo)
logScanResults(logger, scans)