1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

remove nested empty folders (#900)

This commit is contained in:
Alex Xu
2025-04-16 23:07:41 -07:00
committed by GitHub
parent 3e7646bbad
commit 13e71df172

View File

@@ -936,6 +936,10 @@ def detectSuboptimalProcessing(tmppath, orgpath):
os.remove(os.path.join(root, name))
except OSError as e:
raise RuntimeError(f"{name}: {e}")
# remove empty nested folders
for root, dirs, files in os.walk(tmppath, False):
if not files and not dirs:
os.rmdir(root)
if alreadyProcessed:
print("WARNING: Source files are probably created by KCC. The second conversion will decrease quality.")
if GUI: