mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 13:36:35 +00:00
Remove directory manipulation
Added a comment about why these directories aren't matching.
This commit is contained in:
parent
7b1aedf7ae
commit
bcbafaf842
@ -1304,10 +1304,12 @@ class Media(models.Model):
|
|||||||
|
|
||||||
def filename_prefix(self):
|
def filename_prefix(self):
|
||||||
if self.downloaded and self.media_file:
|
if self.downloaded and self.media_file:
|
||||||
mf_path = Path(self.media_file.path)
|
filename = self.media_file.path
|
||||||
filename = str(mf_path.relative_to(self.source.directory_path))
|
|
||||||
else:
|
else:
|
||||||
filename = self.filename
|
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))
|
prefix, ext = os.path.splitext(os.path.basename(filename))
|
||||||
return prefix
|
return prefix
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user