run trunk fmt

This commit is contained in:
Georges-Antoine Assi
2025-11-26 11:15:44 -05:00
parent 28823d39dd
commit 9dfad6cb87
4 changed files with 20 additions and 14 deletions

View File

@@ -213,13 +213,13 @@ def extract_metadata_from_igdb_rom(self: MetadataHandler, rom: Game) -> IGDBMeta
# Mapping from scan.priority.region codes to IGDB game_localizations region identifiers
# IGDB's game_localizations provides regional titles and cover art, but NOT localized descriptions
REGION_TO_IGDB_LOCALE: dict[str, str | None] = {
"us": None, # United States - use default (no localization needed)
"wor": None, # World - use default
"eu": "EU", # Europe region
"jp": "ja-JP", # Japan
"kr": "ko-KR", # Korea
"cn": "zh-CN", # China (Simplified Chinese)
"tw": "zh-TW", # Taiwan (Traditional Chinese)
"us": None, # United States - use default (no localization needed)
"wor": None, # World - use default
"eu": "EU", # Europe region
"jp": "ja-JP", # Japan
"kr": "ko-KR", # Korea
"cn": "zh-CN", # China (Simplified Chinese)
"tw": "zh-TW", # Taiwan (Traditional Chinese)
}
@@ -240,7 +240,7 @@ def get_igdb_preferred_locale() -> str | None:
if igdb_locale is not None:
return igdb_locale
return None # Default - no localization
return None
def extract_localized_data(rom: Game, preferred_locale: str | None) -> tuple[str, str]:
@@ -281,11 +281,15 @@ def extract_localized_data(rom: Game, preferred_locale: str | None) -> tuple[str
return localized_name, cover_url
# Locale not found, fall back to default
log.warning(f"IGDB locale '{preferred_locale}' not found for '{default_name}', using default")
log.warning(
f"IGDB locale '{preferred_locale}' not found for '{default_name}', using default"
)
return default_name, default_cover
def build_igdb_rom(handler: "IGDBHandler", rom: Game, preferred_locale: str | None) -> "IGDBRom":
def build_igdb_rom(
handler: "IGDBHandler", rom: Game, preferred_locale: str | None
) -> "IGDBRom":
"""Build an IGDBRom from IGDB game data with localization support.
Args:

View File

@@ -413,7 +413,9 @@ def build_ss_game(rom: Rom, game: SSGame) -> SSRom:
# Log warning if we had to fall back from the preferred locale
if preferred_languages and used_lang and used_lang != preferred_languages[0]:
log.warning(f"ScreenScraper locale '{preferred_languages[0]}' not found for '{res_name}', using '{used_lang}'")
log.warning(
f"ScreenScraper locale '{preferred_languages[0]}' not found for '{res_name}', using '{used_lang}'"
)
url_cover = ss_metadata["box2d_url"]
url_manual = (

View File

@@ -71,13 +71,13 @@ filesystem: {} # { roms_folder: 'roms' } For example if your folder structure is
# - "hasheous" # Hasheous
# - "flashpoint" # Flashpoint Project
# - "hltb" # HowLongToBeat
# region: # Cover art and game title (only used by Screenscraper)
# region: # Used by IGDB and ScreenScraper for regional variants
# - "us"
# - "wor"
# - "ss"
# - "eu"
# - "jp"
# language: # Cover art and game title (only used by Screenscraper)
# language: # Used by ScreenScraper for descriptions
# - "en"
# - "fr"
# # Media assets to download

View File

@@ -2,8 +2,8 @@
import { computed, onMounted, ref } from "vue";
import { useI18n } from "vue-i18n";
import RSection from "@/components/common/RSection.vue";
import storeHeartbeat from "@/stores/heartbeat";
import storeConfig from "@/stores/config";
import storeHeartbeat from "@/stores/heartbeat";
const { t } = useI18n();
const heartbeat = storeHeartbeat();