Skip to content

Commit

Permalink
use size_in_bytes for normal updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Sep 1, 2024
1 parent 9c7b6c4 commit afa7e3e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/decky_loader/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

class RemoteVerAsset(TypedDict):
name: str
size: int
browser_download_url: str
class RemoteVer(TypedDict):
tag_name: str
Expand Down Expand Up @@ -198,11 +199,13 @@ async def do_update(self):

version = self.remoteVer["tag_name"]
download_url = None
size_in_bytes = None
download_filename = "PluginLoader" if ON_LINUX else "PluginLoader.exe"

for x in self.remoteVer["assets"]:
if x["name"] == download_filename:
download_url = x["browser_download_url"]
size_in_bytes = x["size"]
break

if download_url == None:
Expand Down Expand Up @@ -238,7 +241,7 @@ async def do_update(self):
os.mkdir(path.join(getcwd(), ".systemd"))
shutil.move(service_file_path, path.join(getcwd(), ".systemd")+"/plugin_loader.service")

await self.download_decky_binary(download_url, version)
await self.download_decky_binary(download_url, version, size_in_bytes=size_in_bytes)

async def do_restart(self):
await service_restart("plugin_loader", block=False)
Expand Down

0 comments on commit afa7e3e

Please sign in to comment.