feat: Bump version to 0.3.2 and update related files

This commit is contained in:
sHa
2025-12-28 07:21:48 +00:00
parent fe4c0a4a58
commit 3b7ab1d54e
4 changed files with 22 additions and 19 deletions

BIN
dist/renamer-0.3.2-py3-none-any.whl vendored Normal file

Binary file not shown.

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "renamer" name = "renamer"
version = "0.3.1" version = "0.3.2"
description = "Terminal-based media file renamer and metadata viewer" description = "Terminal-based media file renamer and metadata viewer"
readme = "README.md" readme = "README.md"
requires-python = ">=3.11" requires-python = ">=3.11"

View File

@@ -27,8 +27,8 @@ class OpenScreen(Screen):
if not path.is_dir(): if not path.is_dir():
self.query_one("#dir_input", Input).value = f"Not a directory: {path_str}" self.query_one("#dir_input", Input).value = f"Not a directory: {path_str}"
return return
self.app.scan_dir = path self.app.scan_dir = path # type: ignore
self.app.scan_files() self.app.scan_files() # type: ignore
self.app.pop_screen() self.app.pop_screen()
@@ -175,7 +175,7 @@ Do you want to proceed with renaming?
try: try:
self.old_path.rename(self.new_path) self.old_path.rename(self.new_path)
# Update the tree node # Update the tree node
self.app.update_renamed_file(self.old_path, self.new_path) self.app.update_renamed_file(self.old_path, self.new_path) # type: ignore
self.app.pop_screen() self.app.pop_screen()
except Exception as e: except Exception as e:
# Show error # Show error
@@ -216,17 +216,20 @@ Do you want to proceed with renaming?
self.set_focus(self.query_one("#cancel")) self.set_focus(self.query_one("#cancel"))
elif current.id == "cancel": elif current.id == "cancel":
self.set_focus(self.query_one("#new_name_input")) self.set_focus(self.query_one("#new_name_input"))
elif event.key == "y":
# Trigger rename # Hotkeys only work when not focused on input
try: if not current or not hasattr(current, 'id') or current.id != "new_name_input":
self.old_path.rename(self.new_path) if event.key == "y":
# Update the tree node # Trigger rename
self.app.update_renamed_file(self.old_path, self.new_path) try:
self.old_path.rename(self.new_path)
# Update the tree node
self.app.update_renamed_file(self.old_path, self.new_path) # type: ignore
self.app.pop_screen()
except Exception as e:
# Show error
content = self.query_one("#confirm_content", Static)
content.update(f"Error renaming file: {str(e)}")
elif event.key == "n":
# Cancel
self.app.pop_screen() self.app.pop_screen()
except Exception as e:
# Show error
content = self.query_one("#confirm_content", Static)
content.update(f"Error renaming file: {str(e)}")
elif event.key == "n":
# Cancel
self.app.pop_screen()

2
uv.lock generated
View File

@@ -164,7 +164,7 @@ wheels = [
[[package]] [[package]]
name = "renamer" name = "renamer"
version = "0.3.1" version = "0.3.2"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "langcodes" }, { name = "langcodes" },