From fcf994adafb732746e3be18ec782f751e427972a Mon Sep 17 00:00:00 2001 From: 64Core Date: Tue, 31 May 2022 21:27:21 -0500 Subject: [PATCH] Script now correctly generates folder names, reduced default job count for debugging --- itchiodl/downloader/__main__.py | 2 +- itchiodl/game.py | 12 ++++++------ itchiodl/library.py | 2 +- itchiodl/utils.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/itchiodl/downloader/__main__.py b/itchiodl/downloader/__main__.py index 90b0ab1..5de4a24 100644 --- a/itchiodl/downloader/__main__.py +++ b/itchiodl/downloader/__main__.py @@ -38,7 +38,7 @@ def main(): "-j", "--jobs", type=int, - default=4, + default=1, help="Number of concurrent downloads, defaults to 4", ) diff --git a/itchiodl/game.py b/itchiodl/game.py index 9f0172f..ba5de40 100644 --- a/itchiodl/game.py +++ b/itchiodl/game.py @@ -29,12 +29,12 @@ class Game: self.game_slug = matches.group(2) self.publisher_slug = matches.group(1) - if "VerboseFolders" in globals(): - self.destination_folder = self.game_slug if not VerboseFolders else self.name - else: - self.destination_folder = self.game_slug - print("VerboseFolders Not Detected in Global Variables, Falling Back to Game Slug\n") - self.destination_path = itchiodl.utils.clean_path(f"{self.publisher_slug}/{self.destination_folder}") + #if "VerboseFolders" in globals(): + # self.destination_folder = self.game_slug if not VerboseFolders else self.name + #else: + # self.destination_folder = self.game_slug + # print("VerboseFolders Not Detected in Global Variables, Falling Back to Game Slug\n") + self.destination_path = itchiodl.utils.clean_path(f"{self.publisher_slug}/{self.name}") self.files = [] self.downloads = [] diff --git a/itchiodl/library.py b/itchiodl/library.py index 4c6bc44..cbf627a 100644 --- a/itchiodl/library.py +++ b/itchiodl/library.py @@ -11,7 +11,7 @@ from itchiodl.game import Game class Library: """Representation of a user's game library""" - def __init__(self, login, jobs=4): + def __init__(self, login, jobs=1): self.login = login self.games = [] self.jobs = jobs diff --git a/itchiodl/utils.py b/itchiodl/utils.py index 78a289f..ecc6a4b 100644 --- a/itchiodl/utils.py +++ b/itchiodl/utils.py @@ -40,7 +40,7 @@ def download(url, path, name, file): def clean_path(path): """Cleans a path on windows""" if sys.platform in ["win32", "cygwin", "msys"]: - path_clean = re.replace(r"[\<\>\:\"\/\\\|\?\*]", "-", path) + path_clean = path.replace(r"[\<\>\:\"\/\\\|\?\*]", "-") return path_clean return path