Skip to content

Commit

Permalink
Fix error: there can be Asian characters (instead of spaces) in the d…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
woctezuma committed Jan 1, 2025
1 parent 93d8b7a commit 4e36b79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extend_steamspy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

from my_types import HardCodedIDs

YEAR_LENGTH = len("2025")


def get_hard_coded_steamspy_database_extension() -> HardCodedIDs:
# Entries manually added to SteamSpy's database
Expand Down Expand Up @@ -151,7 +153,7 @@ def get_release_year_for_problematic_app_id(app_id: str) -> int:
release_date_as_str = steampi.calendar.get_release_date_as_str(app_id=app_id)
matched_release_year = release_date_as_str.split(" ")[-1]
try:
matched_release_year_as_int = int(matched_release_year)
matched_release_year_as_int = int(matched_release_year[:YEAR_LENGTH])
except ValueError:
matched_release_year = release_date_as_str.split(" ")[0]
matched_release_year_as_int = int(matched_release_year)
Expand Down

0 comments on commit 4e36b79

Please sign in to comment.