From 29d651bed66a1859dcfd0ac74406a358ba65867e Mon Sep 17 00:00:00 2001 From: AAGaming Date: Thu, 9 Nov 2023 15:35:32 -0500 Subject: [PATCH 1/6] fix: get rid of title view jank on latest beta --- frontend/src/components/PluginView.tsx | 21 +++++++-------------- frontend/src/components/TitleView.tsx | 2 ++ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/PluginView.tsx b/frontend/src/components/PluginView.tsx index b53035f78..a31053fe3 100644 --- a/frontend/src/components/PluginView.tsx +++ b/frontend/src/components/PluginView.tsx @@ -1,12 +1,4 @@ -import { - ButtonItem, - Focusable, - PanelSection, - PanelSectionRow, - joinClassNames, - scrollClasses, - staticClasses, -} from 'decky-frontend-lib'; +import { ButtonItem, Focusable, PanelSection, PanelSectionRow } from 'decky-frontend-lib'; import { VFC, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FaEyeSlash } from 'react-icons/fa'; @@ -36,10 +28,7 @@ const PluginView: VFC = () => { return ( -
+
{(visible || activePlugin.alwaysRender) && activePlugin.content}
@@ -48,7 +37,11 @@ const PluginView: VFC = () => { return ( <> -
+
{pluginList .filter((p) => p.content) diff --git a/frontend/src/components/TitleView.tsx b/frontend/src/components/TitleView.tsx index 111f8c807..357656fab 100644 --- a/frontend/src/components/TitleView.tsx +++ b/frontend/src/components/TitleView.tsx @@ -10,6 +10,8 @@ const titleStyles: CSSProperties = { display: 'flex', paddingTop: '3px', paddingRight: '16px', + position: 'sticky', + top: '0px', }; const TitleView: VFC = () => { From 8f26fdec2d7e280c11f9ef33cd706d7feb172ace Mon Sep 17 00:00:00 2001 From: Party Wumpus <48649272+PartyWumpus@users.noreply.github.com> Date: Fri, 10 Nov 2023 17:19:01 +0000 Subject: [PATCH 2/6] Count the number of installs for each plugin (#557) --- backend/src/browser.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend/src/browser.py b/backend/src/browser.py index da8569bee..966206671 100644 --- a/backend/src/browser.py +++ b/backend/src/browser.py @@ -186,6 +186,18 @@ async def _install(self, artifact: str, name: str, version: str, hash: str): else: logger.fatal(f"Could not fetch from URL. {await res.text()}") + storeUrl = "" + match self.settings.getSetting("store", 0): + case 0: storeUrl = "https://plugins.deckbrew.xyz/plugins" # default + case 1: storeUrl = "https://testing.deckbrew.xyz/plugins" # testing + case 2: storeUrl = self.settings.getSetting("store-url", "https://plugins.deckbrew.xyz/plugins") # custom + case _: storeUrl = "https://plugins.deckbrew.xyz/plugins" + logger.info(f"Incrementing installs for {name} from URL {storeUrl} (version {version})") + async with ClientSession() as client: + res = await client.post(storeUrl+f"/{name}/versions/{version}/increment?isUpdate={isInstalled}", ssl=get_ssl_context()) + if res.status != 200: + logger.error(f"Server did not accept install count increment request. code: {res.status}") + # Check to make sure we got the file if res_zip is None: logger.fatal(f"Could not fetch {artifact}") From 479a16c6557fc9656e1ff601e6ed7e677846d428 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 21:01:48 +0000 Subject: [PATCH 3/6] Bump aiohttp from 3.8.4 to 3.8.5 in /backend (#558) --- backend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index 326a924cf..58493e572 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,4 +1,4 @@ -aiohttp==3.8.4 +aiohttp==3.8.5 aiohttp-jinja2==1.5.1 aiohttp_cors==0.7.0 watchdog==2.1.7 From 75ad98a7b2ce53bf2916a6bfb760599e7b50fc9d Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 11 Nov 2023 21:50:23 +0100 Subject: [PATCH 4/6] Check if Linux service is running before trying to start or stop it (#540) this prevents needless prompts opening up --- backend/src/localplatformlinux.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/localplatformlinux.py b/backend/src/localplatformlinux.py index bde2caac1..846fa0745 100644 --- a/backend/src/localplatformlinux.py +++ b/backend/src/localplatformlinux.py @@ -125,11 +125,19 @@ async def service_restart(service_name : str) -> bool: return res.returncode == 0 async def service_stop(service_name : str) -> bool: + if not await service_active(service_name): + # Service isn't running. pretend we stopped it + return True + cmd = ["systemctl", "stop", service_name] res = run(cmd, stdout=PIPE, stderr=STDOUT) return res.returncode == 0 async def service_start(service_name : str) -> bool: + if await service_active(service_name): + # Service is running. pretend we started it + return True + cmd = ["systemctl", "start", service_name] res = run(cmd, stdout=PIPE, stderr=STDOUT) return res.returncode == 0 From 7c3ae9b62b0991cf9efcfa3d806e06c2fd664816 Mon Sep 17 00:00:00 2001 From: Jan Date: Sat, 11 Nov 2023 21:56:32 +0100 Subject: [PATCH 5/6] replace chmod implementation with os.chmod (#541) --- backend/src/localplatformlinux.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/backend/src/localplatformlinux.py b/backend/src/localplatformlinux.py index 846fa0745..1f857f27d 100644 --- a/backend/src/localplatformlinux.py +++ b/backend/src/localplatformlinux.py @@ -58,8 +58,22 @@ def chown(path : str, user : UserType = UserType.HOST_USER, recursive : bool = def chmod(path : str, permissions : int, recursive : bool = True) -> bool: if _get_effective_user_id() != 0: return True - result = call(["chmod", "-R", str(permissions), path] if recursive else ["chmod", str(permissions), path]) - return result == 0 + + try: + octal_permissions = int(str(permissions), 8) + + if recursive: + for root, dirs, files in os.walk(path): + for d in dirs: + os.chmod(os.path.join(root, d), octal_permissions) + for d in files: + os.chmod(os.path.join(root, d), octal_permissions) + + os.chmod(path, octal_permissions) + except: + return False + + return True def folder_owner(path : str) -> UserType|None: user_owner = _get_user_owner(path) From 0c9104835d35093b7934d185f7f12955a25ffc44 Mon Sep 17 00:00:00 2001 From: Marco Rodolfi Date: Sun, 19 Nov 2023 13:10:01 +0100 Subject: [PATCH 6/6] Implement localized store --- frontend/src/store.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/frontend/src/store.tsx b/frontend/src/store.tsx index fd458bef3..dbd006bff 100644 --- a/frontend/src/store.tsx +++ b/frontend/src/store.tsx @@ -67,7 +67,17 @@ export async function getPluginList(): Promise { headers: { 'X-Decky-Version': version.current, }, - }).then((r) => r.json()); + }).then((r) => { + let res = JSON.parse(JSON.stringify(r.json())); + const lng = navigator.language; + if (res.hasOwnProperty('name-' + lng)) { + res.name = res['name-' + lng]; + } + if (res.hasOwnProperty('description-' + lng)) { + res.description = res['description-' + lng]; + } + return res; + }); } export async function installFromURL(url: string) {