From 895e08d2287b0b682d45992d208c1f2c031656d6 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 5 Nov 2026 21:26:20 +0900 Subject: [PATCH 1/3] fix: error handling --- dzgui/api/steam.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dzgui/api/steam.py b/dzgui/api/steam.py index ab4649c..1bd455a 100644 --- a/dzgui/api/steam.py +++ b/dzgui/api/steam.py @@ -392,13 +392,19 @@ def get_running_app() -> int | None: def get_last_updated(path: Path, appid: int) -> str | None: root_path = get_app_path(path, appid) acf = root_path.joinpath(f"steamapps/appmanifest_{appid}.acf") - return ACF(acf).get_last_updated() + try: + return ACF(acf).get_last_updated() + except Exception as e: + logger.critical(e) def get_last_played(path: Path, appid: int) -> str | None: root_path = get_app_path(path, appid) acf = root_path.joinpath(f"steamapps/appmanifest_{appid}.acf") - return ACF(acf).get_last_played() + try: + return ACF(acf).get_last_played() + except Exception as e: + logger.critical(e) def get_app_allows_downloads(path: Path, appid: int) -> bool: From 3097701e9841dcc63d1f1da7839a53dd0dda917a Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 5 Nov 2026 21:26:37 +0900 Subject: [PATCH 2/3] change: drop explicit import --- dzgui/api/acf.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dzgui/api/acf.py b/dzgui/api/acf.py index ab35b3b..ce243a4 100644 --- a/dzgui/api/acf.py +++ b/dzgui/api/acf.py @@ -1,16 +1,18 @@ import logging import re -from collections.abc import Iterator from datetime import datetime from pathlib import Path -from typing import Any +from typing import Any, TYPE_CHECKING from warnings import deprecated from dzgui.const.constants import APP_NAME logger = logging.getLogger(APP_NAME) +if TYPE_CHECKING: + from collections.abc import Iterator + class ACF: def __init__(self, file: Path) -> None: @@ -43,7 +45,7 @@ class ACF: def dequote(cls, s: str) -> str: return s.rstrip('"').lstrip('"') - def parse(self, lines: Iterator[list[str]]) -> dict[str, str]: + def parse(self, lines: "Iterator[list[str]]") -> dict[str, str]: acf: dict[str, Any] = {} try: while True: From a97766855ddd3317e0d70e65be4865338e47792c Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 5 Nov 2026 21:27:07 +0900 Subject: [PATCH 3/3] chore: dclear typehinting errors --- dzgui/api/steam.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dzgui/api/steam.py b/dzgui/api/steam.py index 1bd455a..40e6bbf 100644 --- a/dzgui/api/steam.py +++ b/dzgui/api/steam.py @@ -396,6 +396,7 @@ def get_last_updated(path: Path, appid: int) -> str | None: return ACF(acf).get_last_updated() except Exception as e: logger.critical(e) + return None def get_last_played(path: Path, appid: int) -> str | None: @@ -405,6 +406,7 @@ def get_last_played(path: Path, appid: int) -> str | None: return ACF(acf).get_last_played() except Exception as e: logger.critical(e) + return None def get_app_allows_downloads(path: Path, appid: int) -> bool: