From bcbafaf8422084a5f7c58d35645547f097dff65b Mon Sep 17 00:00:00 2001 From: tcely Date: Sun, 26 Jan 2025 07:54:14 -0500 Subject: [PATCH] Remove directory manipulation Added a comment about why these directories aren't matching. --- tubesync/sync/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index 72ea2cd8..cfb6ca38 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -1304,10 +1304,12 @@ class Media(models.Model): def filename_prefix(self): if self.downloaded and self.media_file: - mf_path = Path(self.media_file.path) - filename = str(mf_path.relative_to(self.source.directory_path)) + filename = self.media_file.path else: filename = self.filename + # The returned prefix should not contain any directories. + # So, we do not care about the different directories + # used for filename in the cases above. prefix, ext = os.path.splitext(os.path.basename(filename)) return prefix