diff --git a/source/patch_track.py b/source/patch_track.py index 4e6b197..accbfd3 100644 --- a/source/patch_track.py +++ b/source/patch_track.py @@ -44,27 +44,26 @@ def patch_track(self, tracks, total_track="?"): if len(process_list) < max_process: process_list[track_szs_file] = None self.Progress(statut=self.translate("Conversion des courses") + f"\n({i + 1}/{total_track})\n" + - "\n".join([get_nodir(file) for file in process_list.keys()]), add=1) + "\n".join([get_nodir(file) for file in process_list.keys()]), add=1) for track_file in [track_szs_file, track_wu8_file]: if os.path.exists(track_file): if os.path.getsize(track_file) < 1000: # File under this size are corrupted os.remove(track_file) - if not (os.path.exists(track_wu8_file)): - dl_code = self.get_github_file(track_wu8_file) - if dl_code == -1: - error_count += 1 - if error_count > error_max: # Too much track wasn't correctly converted - messagebox.showerror( - self.translate("Erreur"), - self.translate("Trop de course ont eu une erreur du téléchargement.")) - return - else: - messagebox.showwarning(self.translate("Attention"), - self.translate( - "Impossible de télécharger cette course ! (") + - str(error_count) + "/" + str(error_max) + ")") + dl_code = self.get_github_file(track_wu8_file) + if dl_code == -1: + error_count += 1 + if error_count > error_max: # Too much track wasn't correctly converted + messagebox.showerror( + self.translate("Erreur"), + self.translate("Trop de course ont eu une erreur du téléchargement.")) + return + else: + messagebox.showwarning(self.translate("Attention"), + self.translate( + "Impossible de télécharger cette course ! (") + + str(error_count) + "/" + str(error_max) + ")") if not (os.path.exists(track_szs_file)): process_list[track_szs_file] = subprocess.Popen([ @@ -82,7 +81,6 @@ def patch_track(self, tracks, total_track="?"): stderr = process_list[process].stderr.read() if b"wszst: ERROR" in stderr: # Error occured process_list.pop(process) - print(process, stderr) os.remove(process) error_count += 1 if error_count > error_max: # Too much track wasn't correctly converted