fix(gamecard): correct argument order when creating GameCard
All checks were successful
Code check / Check code (push) Successful in 1m15s
All checks were successful
Code check / Check code (push) Successful in 1m15s
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
@@ -28,7 +28,7 @@ class DetailPageManager:
|
||||
self._animations = {}
|
||||
self.portproton_api = PortProtonAPI(Downloader(max_workers=4))
|
||||
|
||||
def openGameDetailPage(self, name, description, cover_path=None, appid="", exec_line="", controller_support="",
|
||||
def openGameDetailPage(self, name, description, cover_path=None, appid="", controller_support="", exec_line="",
|
||||
last_launch="", formatted_playtime="", protondb_tier="", game_source="", anticheat_status=""):
|
||||
"""Open detailed game information page showing all game stats, playtime and settings."""
|
||||
detailPage = QWidget()
|
||||
|
||||
@@ -961,8 +961,8 @@ class MainWindow(QMainWindow):
|
||||
info.get('description', ''),
|
||||
info.get('cover', ''),
|
||||
appid,
|
||||
f"steam://rungameid/{appid}",
|
||||
info.get('controller_support', ''),
|
||||
f"steam://rungameid/{appid}",
|
||||
last_launch,
|
||||
format_playtime(playtime_seconds),
|
||||
info.get('protondb_tier', ''),
|
||||
@@ -1111,8 +1111,8 @@ class MainWindow(QMainWindow):
|
||||
final_desc,
|
||||
final_cover,
|
||||
steam_info.get("appid", ""),
|
||||
exec_line,
|
||||
steam_info.get("controller_support", ""),
|
||||
exec_line,
|
||||
get_last_launch(exe_name) if exe_name else _("Never"),
|
||||
formatted_playtime,
|
||||
steam_info.get("protondb_tier", ""),
|
||||
@@ -1430,8 +1430,8 @@ class MainWindow(QMainWindow):
|
||||
final_desc,
|
||||
final_cover,
|
||||
steam_info.get("appid", ""),
|
||||
exec_line,
|
||||
steam_info.get("controller_support", ""),
|
||||
exec_line,
|
||||
last_launch,
|
||||
formatted_playtime,
|
||||
steam_info.get("protondb_tier", ""),
|
||||
|
||||
@@ -64,23 +64,15 @@ def extract_exe_name(exec_line: str) -> str:
|
||||
|
||||
try:
|
||||
parts = shlex.split(exec_line)
|
||||
# PortProton exec_line format: env VAR=val script game.exe
|
||||
# The exe is usually the 4th part (index 3) or last part ending with .exe
|
||||
if len(parts) >= 4:
|
||||
game_exe = os.path.expanduser(parts[3])
|
||||
else:
|
||||
# Fallback: find first .exe in the command
|
||||
game_exe = exec_line
|
||||
for part in parts:
|
||||
if part.lower().endswith(".exe"):
|
||||
game_exe = os.path.expanduser(part)
|
||||
break
|
||||
|
||||
exe_name = os.path.basename(game_exe)
|
||||
# Ensure .exe extension
|
||||
if exe_name and not exe_name.lower().endswith(".exe"):
|
||||
exe_name = f"{exe_name}.exe"
|
||||
return exe_name
|
||||
# Search for the last part ending with .exe
|
||||
# In PortProton format, the game exe is always the last argument
|
||||
for part in reversed(parts):
|
||||
if part.lower().endswith(".exe"):
|
||||
game_exe = os.path.expanduser(part)
|
||||
return os.path.basename(game_exe)
|
||||
|
||||
return ""
|
||||
except (ValueError, IndexError):
|
||||
return ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user