From 1807e443ea71e5d4e92cee8555ef715dc2695d90 Mon Sep 17 00:00:00 2001 From: TabulateJarl8 Date: Mon, 12 Feb 2024 19:06:35 -0500 Subject: [PATCH] fix caching playtime issue --- pyproject.toml | 2 +- tests/test_cache.py | 1 + tests/test_config.py | 2 +- vapor/cache_handler.py | 3 +-- vapor/data_structures.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9ecda78..f15d239 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] license = "GPLv3" diff --git a/tests/test_cache.py b/tests/test_cache.py index 9408117..455726b 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -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'] diff --git a/tests/test_config.py b/tests/test_config.py index 48d35f5..7e50c11 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -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 diff --git a/vapor/cache_handler.py b/vapor/cache_handler.py index 5494024..b5af125 100644 --- a/vapor/cache_handler.py +++ b/vapor/cache_handler.py @@ -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() @@ -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'], diff --git a/vapor/data_structures.py b/vapor/data_structures.py index 4ab4b75..1f276e0 100644 --- a/vapor/data_structures.py +++ b/vapor/data_structures.py @@ -23,7 +23,7 @@ 'Broken': 'dark_orange3', 'Planned': 'purple', 'Running': 'blue', - 'Supported': 'green', + 'Supported': '#02b302', '': '', } @@ -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'), }