Add support for multiple Steam games of the exact same title. Fixes for example "Wolfenstein II: The New Colossus" having both international and german version under the same name.
This commit is contained in:
parent
42b8b65de9
commit
a42ad64994
|
@ -60,8 +60,10 @@ class Steam(object):
|
||||||
payload = {
|
payload = {
|
||||||
"term": query
|
"term": query
|
||||||
}
|
}
|
||||||
items = {i["name"]: i for i in self.cache.get("https://store.steampowered.com/api/storesearch",
|
# Reverse results to make the first one take precedence over later ones if multiple results have the same name.
|
||||||
params=payload).json()["items"]}
|
# E.g. "Wolfenstein II: The New Colossus" has both international and german version under the same name.
|
||||||
|
items = {i["name"]: i for i in reversed(self.cache.get("https://store.steampowered.com/api/storesearch",
|
||||||
|
params=payload).json()["items"])}
|
||||||
|
|
||||||
best_match = util.case_insensitive_close_matches(query, items, n=1, cutoff=0.90)
|
best_match = util.case_insensitive_close_matches(query, items, n=1, cutoff=0.90)
|
||||||
|
|
||||||
|
|
Reference in a new issue