feat: MangaUpdates Tier 3 search via associated names + LocalizedName write back - #339
Open
xxxarmitagexxx wants to merge 1 commit into
Open
xxxarmitagexxx wants to merge 1 commit into
xxxarmitagexxx wants to merge 1 commit into
Conversation
… 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
force-pushed
the
feat/mangaupdates-tier3-associated-search
branch
from
September 20, 2026 05:31
46ac2e7 to
7932845
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
MetadataServicepasses Kavita's existing alternative titles as additional search terms → still no match if nolocalizedNameis stored yetA 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 callsgetSeries()to fetch the full record. The Kavita series name is then matched againstseries.associated, which lists all known alternate titles. On a match, metadata is returned withmatchedAltTitle = 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,
MetadataServicewrites the matched primary title back to Kavita aslocalizedNamevialanguage = "ja-ro". On the next run,localizedNameis included insearchTitlesand Tier 1 matches directly.ComicInfo durability
Any Kavita library scan resets
series.LocalizedNamefrom theLocalizedSeriesfield in each chapter's ComicInfo. Without this fix, the API write-back is erased on the next scan.MetadataUpdater.updateBookMetadatanow patcheslocalizedSeriesin ComicInfo frommatchedAltTitle(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:
matchedAltTitleA nullable
matchedAltTitle: String?field (defaultnull) is added toProviderSeriesMetadataandSeriesAndBookMetadata. No existing provider interfaces or config-applier contracts change.Files changed
MangaUpdatesMetadataProvider.ktmatchedAltTitleset on matchSeriesMetadata.ktmatchedAltTitle: String?onProviderSeriesMetadataSeriesAndBookMetadata.ktmatchedAltTitle: String?carrierMetadataConfigApplier.ktmatchedAltTitlethrough config filteringMetadataPostProcessor.ktmatchedAltTitlethrough post-processingMetadataService.ktmatchedAltTitleinmatchSeries()return; API write-back afterupdateMetadataMetadataUpdater.ktlocalizedSeriesin ComicInfo frommatchedAltTitleor first language-tagged title