Fix improper game version check

This commit is contained in:
tretrauit 2022-03-30 16:54:47 +07:00
parent 7c45133508
commit c7918f8a20
Signed by: tretrauit
GPG Key ID: 862760FF1903319E
2 changed files with 11 additions and 5 deletions

View File

@ -9,7 +9,7 @@ README = (HERE / "README.md").read_text()
setup(
name='worthless',
version='1.2.9-3',
version='1.2.9-4',
packages=['worthless', 'worthless.classes', 'worthless.classes.launcher', 'worthless.classes.installer'],
url='https://git.froggi.es/tretrauit/worthless-launcher',
license='MIT License',

View File

@ -331,9 +331,12 @@ class Installer:
async def download_game_update(self, from_version: str = None):
if not from_version:
self._version = from_version
if self._version:
from_version = self._version
else:
from_version = self._version = self.get_game_version()
if not from_version:
raise ValueError("Game version not found")
raise ValueError("No game version found")
version_info = await self._launcher.get_resource_info()
if version_info is None:
raise RuntimeError("Failed to fetch game resource info.")
@ -346,9 +349,12 @@ class Installer:
async def download_voiceover_update(self, language: str, from_version: str = None):
if not from_version:
self._version = from_version
if self._version:
from_version = self._version
else:
from_version = self._version = self.get_game_version()
if not from_version:
raise ValueError("Game version not found, use install_game to install the game.")
raise ValueError("No game version found")
version_info = await self._launcher.get_resource_info()
if version_info is None:
raise RuntimeError("Failed to fetch game resource info.")