Files
tdarr-plugs/Local
Tdarr Plugin Developer 44fe7b50b0 Refactor stream_organizer to v4.9 - modular architecture
Major refactoring completed:
- Extracted 15+ focused helper functions from 500-line monolith
- Main plugin() function reduced from ~500 lines to ~150 lines
- Organized into logical sections: Constants, Predicates, Utilities, Analysis, Extraction, Command Building
- Zero behavior changes - all logic preserved exactly
- Improved maintainability, testability, and readability

New structure:
- categorizeStreams() - Stream analysis
- reorderStreamsByLanguage() - Language priority sorting
- analyzeSubtitleConversion() - Conversion detection
- processSubtitleExtraction() - Subtitle file extraction
- processCCExtraction() - CC handling with lock files
- buildFFmpegCommand() - Command construction
- buildCCExtractionCommand() - CC wrapper command

Benefits:
- Each function has single, clear responsibility
- Better error isolation and debugging
- Easier to understand and modify
- Prepared for future unit testing
2025-12-15 12:01:30 -08:00
..