4.0.9-Xentraxx - Major Architecture Refactor
๐ก๏ธ BREAKING CHANGE: Copy Mode Completely Removed
This release removes the --copy flag and all copy mode functionality to ensure complete input directory safety and eliminate data integrity issues.
Why This Change Was Made
- Input Directory Protection: Copy mode was modifying files in the input directory during extension fixing and filename sanitization, violating the principle of data safety
- Simplified Architecture: Removes complex conditional logic that led to inconsistent behavior
- Clearer User Intent: All operations now clearly move files from input to output, with no ambiguity
- Enhanced Reliability: Eliminates edge cases where input files could be modified unexpectedly
Breaking Changes
- โ Removed:
--copycommand line flag - โ Removed:
copyModefrom all configuration APIs - โ Removed: Copy-related conditional logic throughout codebase
- โ New Behavior: All files are always moved from input to output directory
Migration Guide
- Before:
gpth --input source --output dest --copy - After:
gpth --input source --output dest(copy flag no longer needed or supported) - Result: Files will be moved (not copied) from source to destination
- Behavior: Files are relocated from input to output directory with metadata processing applied
Technical Implementation
- FileOperationService: Simplified to move-only operations with cross-device copy+delete fallback
- Moving Strategies: All strategies now use consistent move semantics
- Album Strategies: Duplicate copy strategy still creates copies in album folders when needed
- Configuration System: Streamlined without copy mode complexity
Benefits
- โก Better Performance: Simplified logic reduces overhead
- ๐งน Cleaner Codebase: Removed 400+ lines of conditional copy logic
- ๐ฏ Clearer Semantics: Move operations are explicit and predictable
๐ก๏ธ BREAKING CHANGE: fix extension flag renamed
- Consolidated extension fixing flags into unified
--fix-extensions=<mode>option- Before:
--fix-extensions,--fix-extensions-non-jpeg,--fix-extensions-solo-mode - After:
--fix-extensions=<mode>withnone,standard,conservative,solomodes
- Before:
๐๏ธ Complete Architecture Overhaul
This release represents a fundamental restructuring of the codebase following Clean Architecture principles, providing better maintainability, testability, and performance.
Tl;dr
- fix extenstion flag changed to
--fix-extensions=<mode> - Improved performance.
- CRITICAL FIX: Nothing mode now processes ALL files, preventing data loss in move mode
Critical Bug Fixes
- ๐จ FIXED: Data loss in Nothing mode - Album-only files are now properly moved in Nothing mode instead of being silently skipped, preventing potential data loss when using move mode with
--album-behavior=nothing
Domain-Driven Design Implementation
- Reorganized codebase into distinct layers: Domain, Infrastructure, and Presentation
- Introduced service-oriented architecture with dependency injection container
- Implemented immutable domain entities for better data integrity and performance
- Added comprehensive test coverage with over 200+ unit and integration tests
Service Consolidation & Modernization
- Unified service interfaces through consolidated service pattern
- Implemented ServiceContainer for centralized dependency management
- Refactored moving logic into strategy pattern with pluggable implementations
- Enhanced error handling with proper exception hierarchies and logging
๐ Performance & Reliability Improvements
Async Processing Architecture
- Stream-based file I/O operations replacing synchronous access
- Persistent ExifTool process management (10-50x faster EXIF operations)
- Concurrent media processing with race condition protection
- Memory optimization - up to 99.4% reduction for large file operations
Advanced File Operations
- Streaming hash calculations (20% faster with reduced memory usage)
- Optimized directory scanning (50% fewer I/O operations)
- Parallel file moving operations (40-50% performance improvement)
- Smart duplicate detection with memory-efficient algorithms
- Native Win32 creation time updates - Replaced PowerShell with direct Win32 FFI calls (10-100x faster)
Intelligent Extension Correction
- MIME type validation with file header detection
- RAW format protection - prevents corruption of TIFF-based files
- Comprehensive safety modes for different use cases
- JSON metadata synchronization after extension fixes
๐ Modern File Management
Strategy Pattern Implementation
- Pluggable moving strategies: Nothing, Copy, Shortcut, Reverse Shortcut
- Context-aware path generation with date-based organization
- Atomic file operations with rollback capabilities
- Smart collision handling with unique filename generation
Cross-Platform Improvements
- Platform-specific optimizations for Windows, macOS, and Linux
- Enhanced shortcut creation bypassing PowerShell on Windows
- Unified disk space management across all platforms
- Improved encoding handling for international filenames
๐งช Testing & Quality Assurance
Comprehensive Test Suite
- 200+ automated tests covering unit, integration, and end-to-end scenarios
- Mock service infrastructure for reliable testing
- Performance regression testing with benchmarks
- Cross-platform validation across all supported systems
Code Quality Improvements
- Comprehensive documentation with detailed function descriptions
- Lint rule enforcement following Dart best practices
- Type safety enhancements with null safety
- Error logging standardization with structured log levels
๐ Processing Pipeline Modernization
Eight-Step Pipeline Architecture
- Extension Fixing - Intelligent MIME type correction
- Media Discovery - Optimized file system scanning
- Duplicate Removal - Content-based deduplication
- Date Extraction - Multi-source timestamp resolution
- EXIF Writing - Metadata synchronization
- Album Detection - Smart folder classification
- File Moving - Strategy-based organization
- Creation Time Updates - Final timestamp alignment
Enhanced Data Processing
- MediaEntity immutable models for thread-safe operations
- Coordinate processing with validation and conversion
- JSON metadata matching with truncated filename support
- Album relationship management with shortcut strategies
๐ ๏ธ Infrastructure Enhancements
External Tool Integration
- Persistent ExifTool management with automatic discovery
- Platform service abstraction for system-specific operations
- Disk space monitoring with real-time calculations
- Process lifecycle management with proper cleanup
Interactive User Experience
- Consolidated interactive services with improved prompts
- Real-time progress reporting for long-running operations
- Enhanced error messages with actionable guidance
- ZIP extraction restoration with security improvements
๐ Configuration & Usability
Streamlined Configuration
- Unified command-line interface with consistent flag patterns
- Interactive configuration validation with user guidance
- Global configuration service with centralized settings
- Backward compatibility for existing workflows
Bug Fixes & Stability
- Race condition elimination in concurrent operations
- JSON file matching improvements for truncated names
- Memory leak prevention in long-running processes
- Cross-platform filename handling improvements