feat: Update documentation and project files to reflect enhanced renaming functionality and new features

This commit is contained in:
sHa
2025-12-26 23:14:56 +00:00
parent a6507dec31
commit 1453b753d0
4 changed files with 46 additions and 9 deletions

View File

@@ -2,15 +2,18 @@
## Project Description ## Project Description
This is a Python Terminal User Interface (TUI) application for managing media files. It uses the Textual library to provide a curses-like interface in the terminal. The app allows users to scan directories for video files, display them in a hierarchical tree view, and view detailed metadata information including video, audio, and subtitle tracks. This is a Python Terminal User Interface (TUI) application for managing media files. It uses the Textual library to provide a curses-like interface in the terminal. The app allows users to scan directories for video files, display them in a hierarchical tree view, view detailed metadata information including video, audio, and subtitle tracks, and rename files based on intelligent metadata extraction.
Key features: Key features:
- Recursive directory scanning - Recursive directory scanning
- Tree-based file navigation - Tree-based file navigation with expand/collapse functionality
- Detailed metadata extraction and display from multiple sources - Detailed metadata extraction from multiple sources
- Color-coded information - Intelligent file renaming with proposed names
- Color-coded information display
- Keyboard and mouse navigation - Keyboard and mouse navigation
- Multiple UI screens (main app, directory selection, help, rename confirmation)
- Extensible extractor and formatter architecture - Extensible extractor and formatter architecture
- Loading indicators and error handling
## Technology Stack ## Technology Stack
@@ -19,6 +22,7 @@ Key features:
- PyMediaInfo (detailed track information) - PyMediaInfo (detailed track information)
- Mutagen (embedded metadata) - Mutagen (embedded metadata)
- Python-Magic (MIME type detection) - Python-Magic (MIME type detection)
- Langcodes (language code handling)
- UV (package manager) - UV (package manager)
## Code Structure ## Code Structure

View File

@@ -1,16 +1,18 @@
# Renamer - Media File Renamer and Metadata Editor # Renamer - Media File Renamer and Metadata Editor
A terminal-based (TUI) application for scanning directories, viewing media file details, and managing file metadata. Built with Python and Textual. A terminal-based (TUI) application for scanning directories, viewing media file details, and renaming files based on extracted metadata. Built with Python and Textual.
## Features ## Features
- Recursive directory scanning for video files - Recursive directory scanning for video files
- Tree view navigation with keyboard and mouse support - Tree view navigation with keyboard and mouse support
- Detailed metadata extraction from multiple sources (MediaInfo, filename parsing, embedded metadata) - Detailed metadata extraction from multiple sources (MediaInfo, filename parsing, embedded metadata)
- Intelligent file renaming with proposed names based on metadata
- Color-coded information display - Color-coded information display
- Command-based interface with hotkeys - Command-based interface with hotkeys
- Extensible extractor and formatter system - Extensible extractor and formatter system
- Support for video, audio, and subtitle track information - Support for video, audio, and subtitle track information
- Confirmation dialogs for file operations
## Installation ## Installation
@@ -50,12 +52,25 @@ renamer /path/to/media/directory
- **q**: Quit the application - **q**: Quit the application
- **o**: Open directory selection dialog - **o**: Open directory selection dialog
- **s**: Rescan current directory - **s**: Rescan current directory
- **f**: Refresh metadata for selected file
- **r**: Rename selected file with proposed name
- **p**: Toggle tree expansion (expand/collapse all)
- **h**: Show help screen
### Navigation ### Navigation
- Use arrow keys to navigate the file tree - Use arrow keys to navigate the file tree
- Right arrow: Expand directory
- Left arrow: Collapse directory or go to parent
- Mouse clicks supported - Mouse clicks supported
- Select a video file to view its details in the right panel - Select a video file to view its details in the right panel
### File Renaming
1. Select a media file in the tree
2. Press **r** to initiate rename
3. Review the proposed new name
4. Press **y** to confirm or **n** to cancel
5. The file will be renamed and the tree updated automatically
## Architecture ## Architecture
The application uses a modular architecture with separate extractors and formatters: The application uses a modular architecture with separate extractors and formatters:
@@ -68,11 +83,18 @@ The application uses a modular architecture with separate extractors and formatt
### Formatters ### Formatters
- **MediaFormatter**: Formats extracted data for display - **MediaFormatter**: Formats extracted data for display
- **ProposedNameFormatter**: Generates intelligent rename suggestions
- **TrackFormatter**: Formats video/audio/subtitle track information - **TrackFormatter**: Formats video/audio/subtitle track information
- **SizeFormatter**: Formats file sizes - **SizeFormatter**: Formats file sizes
- **DateFormatter**: Formats timestamps - **DateFormatter**: Formats timestamps
- **DurationFormatter**: Formats time durations - **DurationFormatter**: Formats time durations
- **ResolutionFormatter**: Formats video resolutions - **ResolutionFormatter**: Formats video resolutions
- **TextFormatter**: Text styling utilities
### Screens
- **OpenScreen**: Directory selection dialog
- **HelpScreen**: Application help and key bindings
- **RenameConfirmScreen**: File rename confirmation dialog
### Setup Development Environment ### Setup Development Environment
```bash ```bash
@@ -117,3 +139,4 @@ uv tool uninstall renamer
- pymediainfo: Detailed media track information - pymediainfo: Detailed media track information
- mutagen: Embedded metadata extraction - mutagen: Embedded metadata extraction
- python-magic: MIME type detection - python-magic: MIME type detection
- langcodes: Language code handling

14
ToDo.md
View File

@@ -14,5 +14,15 @@ TODO Steps:
11. ✅ Add custom tree styling with file icons and colored guides 11. ✅ Add custom tree styling with file icons and colored guides
12. ✅ Add scrollable details panel 12. ✅ Add scrollable details panel
13. ✅ Handle markup escaping for file names with brackets 13. ✅ Handle markup escaping for file names with brackets
14. Implement metadata editing capabilities (future steps) 14. Implement file renaming functionality with confirmation dialog
15. Implement file renaming functionality (future steps) 15. ✅ Add proposed name generation based on metadata extraction
16. ✅ Add help screen with key bindings and usage information
17. ✅ Add tree expansion/collapse toggle functionality
18. ✅ Add file refresh functionality to reload metadata for selected file
19. ✅ Optimize tree updates to avoid full reloads after renaming
20. ✅ Add loading indicators for metadata extraction
21. ✅ Add error handling for file operations and metadata extraction
22. Implement metadata editing capabilities (future enhancement)
23. Add batch rename operations (future enhancement)
24. Add configuration file support (future enhancement)
25. Add plugin system for custom extractors/formatters (future enhancement)

View File

@@ -1,7 +1,7 @@
[project] [project]
name = "renamer" name = "renamer"
version = "0.1.1" version = "0.2.0"
description = "Add your description here" description = "Terminal-based media file renamer and metadata viewer"
readme = "README.md" readme = "README.md"
requires-python = ">=3.11" requires-python = ">=3.11"
dependencies = [ dependencies = [