Version 2.0 from testing branch #1

Merged
olesteep merged 105 commits from testing into master 2025-02-18 23:38:05 +03:00
Showing only changes of commit 90a6b4e0c1 - Show all commits

View file

@ -2,6 +2,7 @@ from shutil import copyfile
from glob import glob
import sys
import os
import re
class Utils:
@ -63,7 +64,10 @@ class Utils:
self.printer.info(f"File {filename} copied to compressed folder.")
def check_duplicates(self, source: str, output: str, filename: str) -> str:
duplicates = glob(os.path.join(source, os.path.splitext(filename)[0]+".*"))
files = glob(os.path.join(source, os.path.splitext(filename)[0])+".*")
re_pattern = re.compile(os.path.join(source, os.path.splitext(filename)[0])+r".[a-zA-Z0-9]+$")
duplicates = [f for f in files if re_pattern.match(f)]
if len(duplicates) > 1:
if filename not in self.duplicates:
self.duplicates.append(filename)