Refactor code structure for improved readability and maintainability
This commit is contained in:
BIN
dist/renamer-0.5.6-py3-none-any.whl
vendored
Normal file
BIN
dist/renamer-0.5.6-py3-none-any.whl
vendored
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "renamer"
|
||||
version = "0.5.5"
|
||||
version = "0.5.6"
|
||||
description = "Terminal-based media file renamer and metadata viewer"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
|
||||
@@ -179,9 +179,9 @@ Do you want to proceed with renaming?
|
||||
if event.button.id == "rename":
|
||||
try:
|
||||
logging.info(f"Renaming {self.old_path} to {self.new_path}")
|
||||
self.old_path.rename(self.new_path)
|
||||
self.old_path.rename(self.old_path.with_name(self.new_path)) # type: ignore
|
||||
# Update the tree node
|
||||
self.app.update_renamed_file(self.old_path, self.new_path) # type: ignore
|
||||
self.app.update_renamed_file(self.old_path, self.old_path.with_name(self.new_path)) # type: ignore
|
||||
self.app.pop_screen()
|
||||
except Exception as e:
|
||||
# Show error
|
||||
@@ -229,9 +229,9 @@ Do you want to proceed with renaming?
|
||||
# Trigger rename
|
||||
try:
|
||||
logging.info(f"Hotkey renaming {self.old_path} to {self.new_path}")
|
||||
self.old_path.rename(self.new_path)
|
||||
self.old_path.rename(self.old_path.with_name(self.new_path)) # type: ignore
|
||||
# Update the tree node
|
||||
self.app.update_renamed_file(self.old_path, self.new_path) # type: ignore
|
||||
self.app.update_renamed_file(self.old_path, self.old_path.with_name(self.new_path)) # type: ignore
|
||||
self.app.pop_screen()
|
||||
except Exception as e:
|
||||
# Show error
|
||||
|
||||
Reference in New Issue
Block a user