diff options
| author | Party Wumpus <48649272+PartyWumpus@users.noreply.github.com> | 2023-11-10 17:19:01 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-10 17:19:01 +0000 |
| commit | 8f26fdec2d7e280c11f9ef33cd706d7feb172ace (patch) | |
| tree | 90ef2760fcf9c4a47bf10712062ac5d1b3c7d2dc /backend | |
| parent | 29d651bed66a1859dcfd0ac74406a358ba65867e (diff) | |
| download | decky-loader-8f26fdec2d7e280c11f9ef33cd706d7feb172ace.tar.gz decky-loader-8f26fdec2d7e280c11f9ef33cd706d7feb172ace.zip | |
Count the number of installs for each plugin (#557)v2.10.9-pre1
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/src/browser.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backend/src/browser.py b/backend/src/browser.py index da8569be..96620667 100644 --- a/backend/src/browser.py +++ b/backend/src/browser.py @@ -186,6 +186,18 @@ class PluginBrowser: 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}") |
