Stop when the paths match

This commit is contained in:
tcely 2025-02-05 03:56:48 -05:00 committed by GitHub
parent 26940c86b4
commit 5a477eb97e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1561,6 +1561,8 @@ class Media(models.Model):
if self.downloaded and self.media_file: if self.downloaded and self.media_file:
old_video_path = Path(self.media_file.path) old_video_path = Path(self.media_file.path)
new_video_path = Path(get_media_file_path(self, None)) new_video_path = Path(get_media_file_path(self, None))
if old_video_path == new_video_path:
return
if old_video_path.exists() and not new_video_path.exists(): if old_video_path.exists() and not new_video_path.exists():
old_video_path = old_video_path.resolve(strict=True) old_video_path = old_video_path.resolve(strict=True)