fix(api,web): enrichissement métadonnées — hints locaux et scoring des correspondances

Recherche de fiches par nom peu fiable : sans ISBN, les providers
étaient interrogés avec des titres bruts peu discriminants.

- extraction de hints locaux (titre/auteur/année/isbn du fichier et du
  nom de fichier) persistés dans books.local_metadata_json
- nouveau use-case ScoreMetadataMatch : tri des résultats par score de
  correspondance avant sélection du meilleur candidat
- providers (google-books, open-library, bnf, local) durcis et nourris
  par les hints ; colonne + index local_metadata_json avec migrations
  idempotentes (création et rebuild legacy)
- web : nettoyage de la description de la fiche livre
  (cleanBookDescription, white-space pre-line)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Git Agent
2026-08-23 18:07:29 +02:00
parent 5de46a6f6d
commit 18d73a4db6
21 changed files with 829 additions and 56 deletions

View File

@ -109,6 +109,7 @@ export class ScannerService {
isbn: metadata.isbn,
isbn13: metadata.isbn13,
identifiersJson: metadata.identifiersJson,
localMetadataJson: metadata.localMetadataJson,
language: metadata.language,
publisher: metadata.publisher,
publishedDate: metadata.publishedDate,
@ -137,6 +138,19 @@ export class ScannerService {
isbn: null,
isbn13: null,
identifiersJson: JSON.stringify({ candidates: [], isbn10: null, isbn13: null }),
localMetadataJson: JSON.stringify({
title: basename(filePath, extname(filePath)),
author: null,
year: null,
isbn: null,
fileTitle: basename(filePath, extname(filePath)),
raw: {
title: basename(filePath, extname(filePath)),
author: null,
publishedDate: null,
fileName: basename(filePath, extname(filePath))
}
}),
language: null,
publisher: null,
publishedDate: null,