Now correctly uses the latest Proton-EM

This commit is contained in:
Faugus
2025-08-06 22:51:22 -03:00
parent ccc2f7eaf6
commit fed184a48d
2 changed files with 30 additions and 19 deletions

View File

@@ -230,6 +230,8 @@ class ProtonDownloader(Gtk.Dialog):
def fetch_releases_from_url(self, url, grid):
page = 1
releases = []
seen_tags = set()
while True:
response = requests.get(url, params={"page": page, "per_page": 100})
if response.status_code == 200:
@@ -243,9 +245,11 @@ class ProtonDownloader(Gtk.Dialog):
for release in releases:
tag_name = release["tag_name"]
if tag_name in seen_tags:
continue # ← Evita duplicados
seen_tags.add(tag_name)
if "GloriousEggroll" in url:
# Esperado: GE-Proton8-1
if not tag_name.startswith("GE-Proton"):
continue
try:
@@ -257,18 +261,8 @@ class ProtonDownloader(Gtk.Dialog):
continue
elif "Etaash-mathamsetty" in url:
# Esperado: EM-10.0-4
if not tag_name.startswith("EM-"):
continue
try:
version_str = tag_name.replace("EM-", "")
part1, part2 = version_str.split("-")
major, minor = map(int, part1.split("."))
patch = int(part2)
if (major, minor, patch) < (10, 0, 4):
continue
except Exception:
continue
self.add_release_to_grid(release, grid)

View File

@@ -256,7 +256,6 @@ class FaugusRun:
sys.exit()
def update_protonpath(self, message):
versions = [
d for d in os.listdir(compatibility_dir)
if os.path.isdir(os.path.join(compatibility_dir, d)) and d.startswith("proton-EM-")
@@ -265,7 +264,21 @@ class FaugusRun:
if not versions:
return message
versions.sort(key=lambda v: [int(x) for x in re.findall(r'\d+', v)], reverse=True)
def version_key(v):
version_str = v.replace("proton-EM-", "")
if version_str.isdigit():
return (int(version_str), "")
match = re.match(r"^(\d+)([A-Za-z]*)$", version_str)
if match:
num_part = int(match.group(1))
alpha_part = match.group(2)
return (num_part, alpha_part)
return (0, version_str)
versions.sort(key=version_key, reverse=True)
latest_version = versions[0]
updated_message = re.sub(r'PROTONPATH=Proton-EM\b', f'PROTONPATH={latest_version}', message)
return updated_message
@@ -605,12 +618,16 @@ class FaugusRun:
if "Proton installed successfully" in clean_line:
self.label.set_text(_("Proton-EM is up to date"))
if "UMU_NO_PROTON" in self.message:
if "steamrt3 is up to date" in clean_line or "mtree is OK" in clean_line:
GLib.timeout_add_seconds(0, self.close_warning_dialog)
else:
if "fsync:" in clean_line or "NTSync" in clean_line or "Using winetricks" in clean_line:
GLib.timeout_add_seconds(0, self.close_warning_dialog)
if (
"fsync:" in clean_line
or "NTSync" in clean_line
or "Using winetricks" in clean_line
or "steamrt3 is up to date" in clean_line
or "Command exited with status: 0" in clean_line
or "SingleInstance" in clean_line
or "mtree is OK" in clean_line
):
GLib.timeout_add_seconds(0, self.close_warning_dialog)
def append_to_text_view(self, clean_line):
if self.text_view: