44fe7b50b0c9b092b10b26cfa4794542842c438b
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
Tdarr Plugins
Custom Tdarr plugin stack for media transcoding.
Plugin Stack (Recommended Order)
-
Tdarr_Plugin_misc_fixes (v2.8) - Pre-processing fixes
- Container remuxing (MKV/MP4)
- Stream conforming
- Image stream removal
- TS timestamp fixes
- ISO/DVD file detection
-
Tdarr_Plugin_stream_organizer (v4.8) - Stream organization
- English audio/subtitle prioritization
- Subtitle extraction to SRT
- Closed caption extraction
- SRT standardization
-
Tdarr_Plugin_combined_audio_standardizer (v1.13) - Audio processing
- AAC/Opus encoding
- Stereo downmix creation
- Quality presets
-
Tdarr_Plugin_av1_svt_converter (v2.22) - Video encoding
- AV1 encoding via SVT-AV1
- Resolution scaling
- Bitrate control
Directory Structure
tdarr_plugs/
├── Local/ # Plugin files (mount in Tdarr)
│ └── *.js # Tdarr plugin files
├── agent_notes/ # Development documentation
├── Latest-Reports/ # Error logs for analysis
├── PLUGIN_DOCUMENTATION.md
└── README.md
Usage
Mount /Local as your Tdarr local plugins directory.
Description
Languages
JavaScript
100%