feat: Automatically delete associated source files when an audiobook project is removed.
This commit is contained in:
@@ -567,4 +567,9 @@ async def delete_project(
|
|||||||
import shutil
|
import shutil
|
||||||
shutil.rmtree(project_dir, ignore_errors=True)
|
shutil.rmtree(project_dir, ignore_errors=True)
|
||||||
|
|
||||||
|
if project.source_path:
|
||||||
|
source_file = Path(project.source_path)
|
||||||
|
if source_file.exists():
|
||||||
|
source_file.unlink(missing_ok=True)
|
||||||
|
|
||||||
crud.delete_audiobook_project(db, project_id, current_user.id)
|
crud.delete_audiobook_project(db, project_id, current_user.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user