summaryrefslogtreecommitdiff
path: root/py_modules/lsfg_vk/flatpak_profile_service.py
diff options
context:
space:
mode:
Diffstat (limited to 'py_modules/lsfg_vk/flatpak_profile_service.py')
-rw-r--r--py_modules/lsfg_vk/flatpak_profile_service.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/py_modules/lsfg_vk/flatpak_profile_service.py b/py_modules/lsfg_vk/flatpak_profile_service.py
index ddec116..9eaf9c7 100644
--- a/py_modules/lsfg_vk/flatpak_profile_service.py
+++ b/py_modules/lsfg_vk/flatpak_profile_service.py
@@ -202,7 +202,7 @@ class FlatpakProfileService:
result = self.configuration_service.update_flatpak_config(app_id, config)
if not result.get("success"):
raise RuntimeError(result.get("error") or "Could not update Flatpak profile")
- return self.get_app(app_id)
+ return result
except Exception as error:
return {
"success": False,
@@ -374,8 +374,16 @@ class FlatpakProfileService:
"app_id": fields[0],
"active": active,
"pid": fields[2].strip() if len(fields) > 2 else "",
+ "start_time": self.flatpak_service._process_start_time(
+ fields[2].strip() if len(fields) > 2 else ""
+ ),
})
- running.sort(key=lambda item: (not item["active"], item["app_id"]))
+ running.sort(key=lambda item: (
+ not item["active"],
+ -(item["start_time"] if isinstance(item["start_time"], int) else -1),
+ -int(item["pid"]) if str(item["pid"]).isdigit() else 1,
+ item["app_id"],
+ ))
return {"success": True, "message": "", "error": None, "apps": running}
except Exception as error:
return {"success": False, "message": "", "error": str(error), "apps": []}