From e510e47adff1ce46d9fda188f5950b23d879b7bb Mon Sep 17 00:00:00 2001 From: Dragoon Dorise Date: Fri, 1 Nov 2024 11:25:28 +0100 Subject: [PATCH] fix user_id --- tools/vdf/functions.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/vdf/functions.py b/tools/vdf/functions.py index 3bf5ad9c..8da1a269 100644 --- a/tools/vdf/functions.py +++ b/tools/vdf/functions.py @@ -7,9 +7,6 @@ import sys import argparse -filepath = rf"C:\Program Files (x86)\Steam\userdata\{latest_userid}\config\shortcuts.vdf" -user_id = get_latest_userid() # Obtener el UserID más reciente - def add_shortcut_if_not_exists(filepath, appname, exe_path, startdir, icon=None, tags=None): # Cargar el archivo VDF existente if os.path.exists(filepath): @@ -81,7 +78,7 @@ def remove_shortcut(filepath, appname=None, exe_path=None): vdf.binary_dump(shortcuts, f) -def get_latest_userid(): +def get_user_id(): userdata_path = r"C:\Program Files (x86)\Steam\userdata" # Listar las subcarpetas en userdata @@ -89,9 +86,9 @@ def get_latest_userid(): # Encontrar la carpeta con la última fecha de modificación latest_dir = max(user_dirs, key=os.path.getmtime) - latest_userid = os.path.basename(latest_dir) + user_id = os.path.basename(latest_dir) - return latest_userid + return user_id def get_steam_game_id(exe_path, appname): # Crea el ID hash de Steam @@ -121,4 +118,7 @@ def set_steam_artwork(user_id, game_id, artwork_path): # Copia la imagen personalizada al destino shutil.copy2(artwork_path, dest_path) - print(f"Artwork añadido en: {dest_path}") \ No newline at end of file + print(f"Artwork añadido en: {dest_path}") + +user_id = get_user_id() +filepath = rf"C:\Program Files (x86)\Steam\userdata\{user_id}\config\shortcuts.vdf"