Skip to content

Commit

Permalink
Revert "TransferService: small code optimization for on_transfer_comp…
Browse files Browse the repository at this point in the history
…leted"

This reverts commit 4c8d482.
  • Loading branch information
infirit committed Dec 21, 2024
1 parent af59141 commit e9a0a7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blueman/plugins/applet/TransferService.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ def _on_transfer_completed(self, _manager: Manager, transfer_path: str, success:
dest_dir, ignored = self._make_share_path()
filename = os.path.basename(src)

dest = os.path.join(dest_dir, filename)
if os.path.exists(dest):
if os.path.exists(os.path.join(dest_dir, filename)):
now = datetime.now()
filename = f"{now.strftime('%Y%m%d%H%M%S')}_{filename}"
logging.info(f"Destination file exists, renaming to: {filename}")

dest = os.path.join(dest_dir, filename)
try:
shutil.move(src, dest)
except (OSError, PermissionError):
Expand Down

0 comments on commit e9a0a7c

Please sign in to comment.