Skip to content

Commit

Permalink
switch to new endpoint format
Browse files Browse the repository at this point in the history
  • Loading branch information
PartyWumpus authored Oct 17, 2023
1 parent 42d0816 commit 26617ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ async def _install(self, artifact, name, version, hash):
case 1: storeUrl = "https://testing.deckbrew.xyz" # testing
case 2: storeUrl = self.settings.getSetting("store-url", "https://plugins.deckbrew.xyz") # custom TODO: this won't work properly, maybe change the way the url is handled in the frontend to not include the /plugins bit
case _: storeUrl = "https://plugins.deckbrew.xyz"
logger.info(f"Incrementing {name} from URL {storeUrl}")
logger.info(f"Incrementing installs for {name} from URL {storeUrl} (version {hash})")
async with ClientSession() as client:
await client.post(storeUrl+"/increment", ssl=get_ssl_context(), data={"plugin_name":name,"isUpdate":str(isInstalled)})
# todo: have error handling here? it doesn't really matter if it succeeds or not to be honest.
res = await client.post(storeUrl+"/increment/{hash}?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:
Expand Down

0 comments on commit 26617ae

Please sign in to comment.