Default to empty string idgb id

This commit is contained in:
Georges-Antoine Assi
2023-09-14 09:31:13 -04:00
parent 6cc1fa1e1e
commit 4c81b8d562
2 changed files with 3 additions and 3 deletions

View File

@@ -154,7 +154,7 @@ class IGDBHandler:
or self._search_rom(uc(search_term), p_igdb_id)
)
r_igdb_id = res.get("id", 0)
r_igdb_id = res.get("id", "")
r_slug = res.get("slug", "")
r_name = res.get("name", search_term)
summary = res.get("summary", "")

View File

@@ -28,7 +28,7 @@ def test_get_rom():
assert urlparse(rom["url_screenshots"][0]).hostname == "images.igdb.com"
rom = igdbh.get_rom("Not a real game title", 4)
assert rom["r_igdb_id"] == 0
assert rom["r_igdb_id"] == ""
assert rom["r_slug"] == ""
assert rom["r_name"] == "Not a real game title"
assert not rom["summary"]
@@ -39,7 +39,7 @@ def test_get_rom():
@pytest.mark.vcr()
def test_get_ps2_opl_rom():
rom = igdbh.get_rom("WWE Smack.iso", 8)
assert rom["r_igdb_id"] == 0
assert rom["r_igdb_id"] == ""
assert rom["r_slug"] == ""
assert rom["r_name"] == "WWE Smack"
assert not rom["summary"]