diff --git a/vnrecode/application.py b/vnrecode/application.py index 2b19681..216157e 100755 --- a/vnrecode/application.py +++ b/vnrecode/application.py @@ -39,7 +39,7 @@ class Application: self.__printer.info("Creating folders...") for folder, folders, files in os.walk(source): - output = Path(folder.replace(str(source), str(self.__params.dest))) + output = self.__utils.get_comp_subdir(folder) if not output.exists(): os.mkdir(output) diff --git a/vnrecode/utils.py b/vnrecode/utils.py index c30abe3..af0dd8c 100644 --- a/vnrecode/utils.py +++ b/vnrecode/utils.py @@ -37,6 +37,14 @@ class Utils: """ return hashlib.md5(filename.encode()).hexdigest()[:8] + def get_comp_subdir(self, folder: str) -> Path: + """ + Method returns the Path from str, changing the source folder in it to a compressed one + :param folder: source subfolder + :return: Path object with compressed subfolder + """ + return Path(folder.replace(str(self.__params.source), str(self.__params.dest), 1)) + def get_recode_status(self): """ Method prints recoding results