Skip to content

Conversation

@tvdu29
Copy link
Contributor

@tvdu29 tvdu29 commented Nov 20, 2025

Description

Having the possibility to pull metadata in my language and proper jacket for my version of the games is something I really want :)

This PR adds the possibility to choose a locale for compatible metadata sources. It is a bit crude for now but I find it to be a nice first step.

  • Add provider-specific locale configuration for IGDB and ScreenScraper
  • IGDB: Support for ja-JP, ko-KR, zh-CN, zh-TW, and EU regions
  • ScreenScraper: Support for en, fr, de, es, it, pt languages
  • Settings UI with locale dropdowns in Metadata Sources section
  • Fallback warnings when requested locale is not available

This PR was written primarily by Claude Code.

Checklist

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Screenshots

{0DC08048-F618-47E4-84FC-CC0E002FEA2D} {190C5F0E-6369-4F36-BEC4-1D2337E5EE6D} {990C93E6-A83C-4830-93BB-C4D4FF4F38B1}

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @tvdu29, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience by allowing personalized metadata retrieval. It introduces a new configuration option for specifying preferred locales for IGDB and ScreenScraper, ensuring that game titles, summaries, and cover art are displayed in the user's chosen language or region when available. This feature is supported by backend logic for configuration management and API integration, alongside a user-friendly frontend interface for setting these preferences, complete with intelligent fallbacks.

Highlights

  • Metadata Locale Selection: Introduced the ability to select specific locales for metadata retrieval from IGDB and ScreenScraper.
  • Provider-Specific Locale Support: IGDB now supports 'ja-JP', 'ko-KR', 'zh-CN', 'zh-TW', and 'EU' regions, while ScreenScraper supports 'en', 'fr', 'de', 'es', 'it', 'pt' languages.
  • User Interface Integration: Added new dropdowns in the Metadata Sources settings UI for easy locale configuration.
  • Robust Fallback Mechanism: Implemented warnings and fallbacks to default languages/regions when a requested locale is not available from the metadata provider.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable feature, allowing users to select metadata locales for IGDB and ScreenScraper. The implementation is solid, with good separation of concerns in the backend and a clean UI on the frontend. The refactoring in igdb_handler.py to remove duplicated code is a significant improvement. I've identified a few areas for improvement, mainly concerning potential performance optimizations by reducing file I/O and removing some unused code that was likely part of an earlier implementation approach. Overall, this is a great step forward for metadata customization.

@gantoine
Copy link
Member

excited to try this! can you post an example of the value of provider_locales in config.yml/

@gantoine gantoine marked this pull request as draft November 20, 2025 18:58
@tvdu29
Copy link
Contributor Author

tvdu29 commented Nov 20, 2025

excited to try this! can you post an example of the value of provider_locales in config.yml/

Hey! Here's an example of how provider_locales looks in config.yml:

scan:
  provider_locales:
    igdb: "ja-JP"
    ss: "fr"

Currently supported locales:

IGDB (region codes - there may be more available, default is US version):

  • ja-JP - Japanese
  • ko-KR - Korean
  • zh-CN - Chinese Simplified
  • zh-TW - Chinese Traditional
  • EU - Europe

ScreenScraper (language codes):

  • en - English
  • fr - Français
  • de - Deutsch
  • es - Español
  • it - Italiano
  • pt - Português

@gantoine
Copy link
Member

right so we already support languages under scan.priority.region, if you'd like i can take what you built here and merge the two, mapping to the IGDB ones. how does that sound?

@tvdu29
Copy link
Contributor Author

tvdu29 commented Nov 21, 2025

right so we already support languages under scan.priority.region, if you'd like i can take what you built here and merge the two, mapping to the IGDB ones. how does that sound?

Thanks for the offer! I have to admit I was pretty confused about the distinction between region and locale while building this, so apologies if I've mixed things up.

Here's what I understand now about how they're currently used:

ScreenScraper:

  • scan.priority.region selects which regional game name and artwork to prefer (e.g., "Resident Evil" with US box art vs "Biohazard" with JP box art)
  • provider_locales.ss selects which language for synopsis/description (e.g., French vs English)
  • Both filter client-side after receiving all data from the API

IGDB:

  • provider_locales.igdb selects from game_localizations API field, which provides region-specific localized names and covers (e.g., "ja-JP" → Japanese title and cover)
  • Also client-side filtering after receiving all localizations

The difference:
For ScreenScraper, region and language serve different purposes (name/artwork vs description language). For IGDB, they're combined in game_localizations.

If you think there's a cleaner way to structure this by mapping scan.priority.region to IGDB's region identifiers, I'm definitely open to it! Just want to make sure we preserve the ability to set ScreenScraper's language separately from its region preference.

@gantoine
Copy link
Member

If you think there's a cleaner way to structure this by mapping scan.priority.region to IGDB's region identifiers, I'm definitely open to it!

I think you nailed it here, we co-opt scan.priority.region (or scan.priority.lang) and map it to IGDB's expected locales. you can pick either one, and lmk if you want a hand with the implementation.

tvdu29 and others added 2 commits November 23, 2025 00:01
- Add provider-specific locale config with UI dropdowns in Settings
- ScreenScraper: select language for synopsis/metadata
- IGDB: select region for localized names/covers
- Fallback warnings when locale not found

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@tvdu29 tvdu29 force-pushed the feature/metadata-locale-selection branch from de27396 to 6a85f9a Compare November 22, 2025 23:04
Remove provider-specific locale configuration and use existing scan.priority.region for IGDB regional variants.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@tvdu29
Copy link
Contributor Author

tvdu29 commented Nov 23, 2025

You're right - I've reimplemented IGDB to use scan.priority.region as you suggested.

I realize now that ScreenScraper was already using scan.priority.language - I should have checked master more carefully before adding the provider-specific override. My apologies for that oversight!

Changes

IGDB Handler:

  • Now uses scan.priority.region to determine locale (maps jpja-JP, euEU, etc.)
  • Fetches localized game titles and cover art from IGDB's game_localizations API
  • Automatically falls back to default when locale unavailable

ScreenScraper Handler:

  • Added locale fallback warning for better observability

Configuration:

scan:
  priority:
    region: ["jp", "eu", "us"]  # Used by IGDB for regional variants
    language: ["fr", "en"]       # Used by ScreenScraper for descriptions

@zurdi15 zurdi15 changed the title Add metadata locale selection for IGDB and ScreenScraper feat: Add metadata locale selection for IGDB and ScreenScraper Nov 26, 2025
@gantoine gantoine marked this pull request as ready for review November 26, 2025 16:14
@gantoine
Copy link
Member

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable feature allowing users to select metadata locales for IGDB and ScreenScraper, enhancing the user experience by providing localized game information. The refactoring in igdb_handler.py to use a dedicated build_igdb_rom function is a good step towards reducing code duplication and improving maintainability. The addition of warning logs when a preferred locale is not found is also a thoughtful touch for debugging and user feedback.

@gantoine gantoine merged commit 306ab84 into rommapp:master Nov 26, 2025
2 of 3 checks passed
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.

2 participants