Add working removal

This commit is contained in:
Jakob Moser 2025-05-24 19:41:14 +02:00
parent da023a5ae2
commit 424942429d
Signed by: jakob
GPG Key ID: 3EF2BA2851B3F53C

View File

@ -1,5 +1,6 @@
from dataclasses import dataclass
from pathlib import Path
import shutil
from karaokatalog.deduplicate.instructions.Instruction import Instruction
@ -16,4 +17,4 @@ class DeleteInstruction(Instruction):
try:
self.path_to_delete.unlink()
except IsADirectoryError:
self.path_to_delete.rmdir()
shutil.rmtree(self.path_to_delete)