Remove RAM warning and show available RAM under general info as well (#77)

* Remove stub logs from default log levels

* Remove RAM warning

* Show available and total RAM under general info
This commit is contained in:
TSRBerry 2023-10-09 22:53:20 +02:00 committed by GitHub
parent c33f4f29a2
commit 04add0f364
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,7 +29,6 @@ class LogAnalyser:
_log_text: str _log_text: str
_log_errors: list[list[str]] _log_errors: list[list[str]]
_hardware_info: dict[str, Optional[str]] _hardware_info: dict[str, Optional[str]]
_ram_available_mib: int
_emu_info: dict[str, Optional[str]] _emu_info: dict[str, Optional[str]]
_game_info: dict[str, Optional[str]] _game_info: dict[str, Optional[str]]
_settings: dict[str, Optional[str]] _settings: dict[str, Optional[str]]
@ -178,7 +177,6 @@ class LogAnalyser:
"aspect_ratio": "Unknown", "aspect_ratio": "Unknown",
"texture_recompression": "Unknown", "texture_recompression": "Unknown",
} }
self._ram_available_mib = -1
self._notes = [] self._notes = []
self._log_errors = [] self._log_errors = []
@ -222,14 +220,16 @@ class LogAnalyser:
if ram_match.group(4) == "GB": if ram_match.group(4) == "GB":
ram_available *= 1024 ram_available *= 1024
ram_total = float(ram_match.group(1))
if ram_match.group(2) == "GB":
ram_total *= 1024
self._hardware_info[ self._hardware_info[
setting setting
] = f"{ram_match.group(1)} {ram_match.group(2)}" ] = f"{ram_available}/{ram_total} MiB"
self._ram_available_mib = int(ram_available)
except ValueError: except ValueError:
# ram_match.group(3) couldn't be parsed as a float. # ram_match.group(1) or ram_match.group(3) couldn't be parsed as a float.
self._hardware_info[setting] = "Error" self._hardware_info[setting] = "Error"
self._ram_available_mib = -1
case "os": case "os":
os_match = re.search( os_match = re.search(
@ -422,7 +422,7 @@ class LogAnalyser:
) )
def __get_log_notes(self): def __get_log_notes(self):
default_logs = ["Info", "Warning", "Error", "Guest", "Stub"] default_logs = ["Info", "Warning", "Error", "Guest"]
user_logs = [] user_logs = []
if self._emu_info["logs_enabled"] is not None: if self._emu_info["logs_enabled"] is not None:
user_logs = ( user_logs = (
@ -548,11 +548,6 @@ class LogAnalyser:
"⚠️ Default user profile in use, consider creating a custom one." "⚠️ Default user profile in use, consider creating a custom one."
) )
if 8192 > self._ram_available_mib > -1:
self._notes.append(
f"⚠️ Less than 8GB RAM available ({self._ram_available_mib} MB)"
)
self.__get_controller_notes() self.__get_controller_notes()
self.__get_os_notes() self.__get_os_notes()