Skip to content

Commit

Permalink
Merge pull request #12 from TabulateJarl8/fix-cache-storing-playtime
Browse files Browse the repository at this point in the history
Fix caching playtime issue
  • Loading branch information
TabulateJarl8 authored Feb 13, 2024
2 parents cbe8597 + 1807e44 commit 4b0eea6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "vapor-steam"
version = "1.5.2"
version = "1.5.3"
description = "TUI program to check the ProtonDB compatibility of all the games of a Steam user."
authors = ["TabulateJarl8 <[email protected]>"]
license = "GPLv3"
Expand Down
1 change: 1 addition & 0 deletions tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def test_update_cache(cache, cache_data):
updated_data = json.loads(f.read())
assert '654321' in updated_data['game_cache']
assert '987654' in updated_data['anticheat_cache']['data']
assert 'playtime' not in updated_data['game_cache']['654321']
assert (
updated_data['game_cache']['483']['timestamp']
== cache_data['game_cache']['483']['timestamp']
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __exit__(self, *_):
@pytest.fixture
def config():
cfg = Config()
cfg._config_path = InMemoryPath()
cfg._config_path = InMemoryPath() # type: ignore
return cfg


Expand Down
3 changes: 1 addition & 2 deletions vapor/cache_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def _serialize_game_data(self) -> dict:
app_id: {
'name': game[0].name,
'rating': game[0].rating,
'playtime': game[0].playtime,
'timestamp': game[1],
}
for app_id, game in self._games_data.items()
Expand Down Expand Up @@ -119,7 +118,7 @@ def load_cache(self, prune=True) -> Self:
Game(
game_cache['name'],
rating=game_cache['rating'],
playtime=game_cache['playtime'],
playtime=0,
app_id=app_id,
),
game_cache['timestamp'],
Expand Down
4 changes: 2 additions & 2 deletions vapor/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'Broken': 'dark_orange3',
'Planned': 'purple',
'Running': 'blue',
'Supported': 'green',
'Supported': '#02b302',
'': '',
}

Expand Down Expand Up @@ -101,5 +101,5 @@ class SteamUserData(NamedTuple):
'silver': ProtonDBRating(weight=3, color='#A6A6A6'),
'gold': ProtonDBRating(weight=4, color='#CFB53B'),
'platinum': ProtonDBRating(weight=5, color='#B4C7DC'),
'native': ProtonDBRating(weight=6, color='green'),
'native': ProtonDBRating(weight=6, color='#02b302'),
}

0 comments on commit 4b0eea6

Please sign in to comment.