bookclerk_resolve::normalize
Title and author cleaning for compares.
Port of cleanTitleForCompares and cleanAuthorForCompares from
audiobookshelf (server/finders/BookFinder.js), moved here from
bookclerk-enrich's match_score so the resolver's work matcher and the
enrichment score clean text the same way.
Because it derives from audiobookshelf, this module is licensed under GPL-3.0-only rather than the workspace's AGPL-3.0-or-later.
| Item | Kind | Summary |
|---|---|---|
has_subtitle |
function | True when the title already embeds a subtitle after : or -. |
clean_title |
function | Cleans a title for compares (AudioBookshelf cleanTitleForCompares). |
clean_author |
function | Cleans an author name for compares (AudioBookshelf cleanAuthorForCompares). |
pub fn has_subtitle(title: &str) -> bool
True when the title already embeds a subtitle after : or -.
title- Display title.
True when a subtitle separator is present.
pub fn clean_title(title: &str, keep_subtitle: bool) -> String
Cleans a title for compares (AudioBookshelf cleanTitleForCompares).
The caller decodes HTML entities first; this function treats &
as literal text.
title- Display title.keep_subtitle- When true, retain subtitle text for soft compares.
String result for this operation.
pub fn clean_author(author: &str) -> String
Cleans an author name for compares (AudioBookshelf cleanAuthorForCompares).
The caller decodes HTML entities first.
author- Stringauthorfor this call.
String result for this operation.
Generated from crates/bookclerk-resolve at main · View as Markdown