Compare commits

..

2 Commits

Author SHA1 Message Date
Chubby Granny Chaser
3928770ef8 Merge branch 'main' into fix/HYD-860 2025-06-03 13:35:10 +01:00
Chubby Granny Chaser
de1dfca57e fix: fixing playtime dir on linux 2025-06-03 13:33:48 +01:00
2 changed files with 42 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ from torrent_downloader import TorrentDownloader
from http_downloader import HttpDownloader
from profile_image_processor import ProfileImageProcessor
import libtorrent as lt
import os
app = Flask(__name__)
@@ -102,8 +103,26 @@ def process_list():
if auth_error:
return auth_error
process_list = [proc.info for proc in psutil.process_iter(['exe', 'cwd', 'pid', 'name', 'environ'])]
return jsonify(process_list), 200
processes = []
for proc in psutil.process_iter(['exe', 'cwd', 'pid', 'cmdline']):
try:
info = proc.info
cmdline = info.get('cmdline') or []
wine_launched_exe = None
for arg in cmdline:
if isinstance(arg, str) and arg.lower().endswith(".exe"):
wine_launched_exe = os.path.basename(arg)
break
exe_path = info.get('exe') or ''
info['name'] = wine_launched_exe or os.path.basename(exe_path)
processes.append(info)
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
continue
return jsonify(processes), 200
@app.route("/profile-image", methods=["POST"])
def profile_image():

View File

@@ -17,18 +17,30 @@ export interface SteamAppDetailsResponse {
};
}
export const getSteamLocation = async () => {
export const getSteamLocation = async (): Promise<string> => {
const home = SystemPath.getPath("home");
if (process.platform === "linux") {
return path.join(SystemPath.getPath("home"), ".local", "share", "Steam");
const candidates = [
path.join(home, ".local", "share", "Steam"),
path.join(home, ".steam", "steam"),
path.join(home, ".steam", "root"),
];
for (const candidate of candidates) {
try {
fs.accessSync(candidate, fs.constants.F_OK);
return candidate;
} catch {
continue;
}
}
throw new Error("Steam installation not found on Linux");
}
if (process.platform === "darwin") {
return path.join(
SystemPath.getPath("home"),
"Library",
"Application Support",
"Steam"
);
return path.join(home, "Library", "Application Support", "Steam");
}
const regKey = new WinReg({
@@ -39,7 +51,7 @@ export const getSteamLocation = async () => {
return new Promise<string>((resolve, reject) => {
regKey.get("SteamPath", (err, value) => {
if (err) {
reject(err);
return reject(err);
}
resolve(value.value);