fix(attachment): keep custom fonts after mux cleanup

Attachment.delete() now removes a file only when it is in the temp directory, so fonts attached from the custom fonts directory survive.
This commit is contained in:
imSp4rky
2026-10-04 12:18:02 -06:00
parent 825678a1c4
commit 07e6a75165
4 changed files with 27 additions and 23 deletions
+3 -2
View File
@@ -154,8 +154,9 @@ class Attachment:
return hex(checksum)
def delete(self) -> None:
if self.path and self.path.exists():
self.path.unlink()
"""Delete the file only if it is in the temp directory. Files in other locations belong to the user."""
if self.path and self.path.is_relative_to(config.directories.temp):
self.path.unlink(missing_ok=True)
self.path = None
@classmethod
+1 -2
View File
@@ -1003,8 +1003,7 @@ class Tracks:
for track in self:
track.delete()
for attachment in self.attachments:
if attachment.path and attachment.path.exists():
attachment.path.unlink()
attachment.delete()
__all__ = ("Tracks",)