1
0
Fork 0
mirror of synced 2024-06-28 11:11:15 +12:00

Fix Launch Progressbar

This commit is contained in:
Dummerle 2021-04-16 18:56:33 +02:00
parent 93acab85c0
commit 709b4dcc8d
2 changed files with 4 additions and 5 deletions

View file

@ -78,7 +78,6 @@ class LaunchDialog(QDialog):
def launch(self):
# self.core = core
self.pb_size = len(self.core.get_game_and_dlc_list())
self.info_text.setText(self.tr("Downloading Images"))
self.thread = LaunchThread(self.core, self)
self.thread.download_progess.connect(self.update_pb)
@ -86,7 +85,7 @@ class LaunchDialog(QDialog):
self.thread.start()
def update_pb(self, i: int):
self.info_pb.setValue(i / self.pb_size * 100)
self.info_pb.setValue(i)
def info(self, text: str):
if text == "finish":

View file

@ -27,14 +27,14 @@ def download_images(signal: pyqtSignal, core: LegendaryCore):
dlc_list = []
for i in dlcs.values():
dlc_list.append(i[0])
l = games + dlc_list
for i, game in enumerate(l):
game_list = games + dlc_list
for i, game in enumerate(game_list):
try:
download_image(game)
except json.decoder.JSONDecodeError:
shutil.rmtree(f"{IMAGE_DIR}/{game.app_name}")
download_image(game)
signal.emit(i)
signal.emit(i/len(game_list)*100)
def download_image(game, force=False):