made the download results prettier

This commit is contained in:
Hellow 2023-04-04 21:14:49 +02:00
parent 545cf98f79
commit 46eab5cbb0
2 changed files with 3 additions and 2 deletions

View File

@ -65,7 +65,6 @@ def cli():
r = search.download_chosen() r = search.download_chosen()
print() print()
print(r) print(r)
print(r._error_message_list)
return True return True
url = re.match(URL_REGGEX, query) url = re.match(URL_REGGEX, query)

View File

@ -42,7 +42,9 @@ class DownloadResult:
def __str__(self): def __str__(self):
if self.fatal_error: if self.fatal_error:
return self.error_message return self.error_message
head = f"({int(self.success_percentage*100)}%) {self.fail} from {self.total} downloads failed." head = f"{self.fail} from {self.total} downloads failed:\n" \
f"successrate:\t{int(self.success_percentage*100)}%\n" \
f"failrate:\t\t{int(self.failure_percentage*100)}%"
if self.failure_percentage <= SHOW_DOWNLOAD_ERRORS_THRESHOLD: if self.failure_percentage <= SHOW_DOWNLOAD_ERRORS_THRESHOLD:
return head return head