Skip to content

feat: MangaUpdates Tier 3 search via associated names + LocalizedName write back - #339

Open
xxxarmitagexxx wants to merge 1 commit into
Snd-R:masterfrom
xxxarmitagexxx:feat/mangaupdates-tier3-associated-search
Open

xxxarmitagexxx wants to merge 1 commit into
Snd-R:masterfrom
xxxarmitagexxx:feat/mangaupdates-tier3-associated-search

Conversation

@xxxarmitagexxx

Copy link
Copy Markdown

Body:

Problem

When a Kavita series name is an English title but MangaUpdates indexes the series under its Japanese romanisation as the primary title, matching fails at every tier:

  • Tier 1 — direct search with series name, compare against primary MangaUpdates title → no match
  • Tier 2MetadataService passes Kavita's existing alternative titles as additional search terms → still no match if no localizedName is stored yet

A typical example: Kavita holds "Attack on Titan", MangaUpdates primary title is "Shingeki no Kyojin". The series goes unmatched despite being present in the search results.

Solution: Tier 3 search

Inside MangaUpdatesMetadataProvider, after Tier 1 fails, the provider iterates each result already returned by the search and calls getSeries() to fetch the full record. The Kavita series name is then matched against series.associated, which lists all known alternate titles. On a match, metadata is returned with matchedAltTitle = series.title (the MangaUpdates primary title).

Tier 3 typically requires one extra API call when the correct series appears first in search results. Once the write-back below runs, Tier 3 is never needed again for that series.

Write-back: making the match stick

When Tier 3 fires, MetadataService writes the matched primary title back to Kavita as localizedName via language = "ja-ro". On the next run, localizedName is included in searchTitles and Tier 1 matches directly.

ComicInfo durability

Any Kavita library scan resets series.LocalizedName from the LocalizedSeries field in each chapter's ComicInfo. Without this fix, the API write-back is erased on the next scan.

MetadataUpdater.updateBookMetadata now patches localizedSeries in ComicInfo from matchedAltTitle (Tier 3) or, as a general fallback, from the first language-tagged title in the unprocessed provider metadata. All subsequent scans read the correct value back.

New field: matchedAltTitle

A nullable matchedAltTitle: String? field (default null) is added to ProviderSeriesMetadata and SeriesAndBookMetadata. No existing provider interfaces or config-applier contracts change.

Files changed

File Change
MangaUpdatesMetadataProvider.kt Tier 3 loop + matchedAltTitle set on match
SeriesMetadata.kt matchedAltTitle: String? on ProviderSeriesMetadata
SeriesAndBookMetadata.kt matchedAltTitle: String? carrier
MetadataConfigApplier.kt forwards matchedAltTitle through config filtering
MetadataPostProcessor.kt preserves matchedAltTitle through post-processing
MetadataService.kt propagates matchedAltTitle in matchSeries() return; API write-back after updateMetadata
MetadataUpdater.kt patches localizedSeries in ComicInfo from matchedAltTitle or first language-tagged title

… write-back

When a Kavita series name is an English title but MangaUpdates indexes the
series under its Japanese romanisation as the primary title, Tier 1 and Tier 2
matching both fail. This adds a Tier 3 fallback inside MangaUpdatesMetadataProvider
that fetches the full series record for each search result and checks the
associated names list. On a match, matchedAltTitle is set to the MangaUpdates
primary title and returned with the metadata.

Write-back: when Tier 3 fires, MetadataService writes the matched primary title
back to Kavita as localizedName (via language=ja-ro on an alternative title). On
subsequent runs the localised name appears in searchTitles and Tier 1 matches
directly — Tier 3 is never needed again for that series.

ComicInfo durability: any Kavita library scan resets series.LocalizedName to the
value of LocalizedSeries in each chapter's ComicInfo. Without this fix the
localised name written by the API is erased on the next scan. MetadataUpdater now
patches localizedSeries in ComicInfo from matchedAltTitle (Tier 3 match) or, as a
fallback, from the first language-tagged title in the raw provider metadata.

New field matchedAltTitle: String? is nullable with a null default so there is no
change to existing provider interfaces or config-applier contracts.
@xxxarmitagexxx
xxxarmitagexxx force-pushed the feat/mangaupdates-tier3-associated-search branch from 46ac2e7 to 7932845 Compare September 20, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant