mirror of
https://github.com/rommapp/romm.git
synced 2026-12-04 12:52:19 +01:00
Refactor extract_metadata_from_igdb_rom to streamline youtube_video_id retrieval
This commit is contained in:
@@ -96,11 +96,9 @@ class IGDBRom(TypedDict):
|
||||
|
||||
|
||||
def extract_metadata_from_igdb_rom(rom: dict) -> IGDBMetadata:
|
||||
youtube_video_id = pydash.get(rom, "videos[0].video_id", None)
|
||||
youtube_video_id = str(youtube_video_id) if youtube_video_id is not None else None
|
||||
return IGDBMetadata(
|
||||
{
|
||||
"youtube_video_id": youtube_video_id,
|
||||
"youtube_video_id": pydash.get(rom, "videos[0].video_id", None),
|
||||
"total_rating": str(round(rom.get("total_rating", 0.0), 2)),
|
||||
"aggregated_rating": str(round(rom.get("aggregated_rating", 0.0), 2)),
|
||||
"first_release_date": rom.get("first_release_date", None),
|
||||
|
||||
Reference in New Issue
Block a user