94 lines
3.4 KiB
Markdown
94 lines
3.4 KiB
Markdown
# Plugin Consolidation and Optimization Summary
|
|
|
|
**Date**: January 27, 2026
|
|
**Status**: ✅ Complete
|
|
|
|
## Overview
|
|
|
|
Consolidated and optimized the Local Plugins by removing redundancies, fixing bugs, and improving efficiency.
|
|
|
|
## Actions Taken
|
|
|
|
### 1. Archived Redundant Plugins
|
|
|
|
Moved the following redundant plugins to `agent-notes/archived/`:
|
|
|
|
#### `Tdarr_Plugin_misc_fixes.js`
|
|
- **Reason**: Redundant "megamix" plugin that duplicates functionality from:
|
|
- Plugin 01 (Container Remux)
|
|
- Plugin 02 (Stream Cleanup)
|
|
- Plugin 03 (Stream Ordering)
|
|
- **Issues Found**:
|
|
- Bug: Referenced undefined variable `needsReorder` on line 286
|
|
- Incomplete implementation: `ensure_video_first` option not fully implemented
|
|
|
|
#### `Tdarr_Plugin_stream_organizer.js`
|
|
- **Reason**: Redundant plugin that duplicates functionality from:
|
|
- Plugin 03 (Stream Ordering)
|
|
- Plugin 04 (Subtitle Conversion)
|
|
- Plugin 05 (Subtitle Extraction)
|
|
- Plugin 06 (CC Extraction)
|
|
- **Note**: While feature-rich, the modular numbered plugins provide better separation of concerns
|
|
|
|
### 2. Optimizations Applied
|
|
|
|
#### Plugin 01 - Container Remux
|
|
- **Optimization**: Consolidated `hasSubtitles()` function from filter+map to single-pass loop
|
|
- **Impact**: Reduces stream iteration from 2 passes to 1 pass
|
|
- **Code**: Lines 127-134
|
|
|
|
### 3. Remaining Active Plugins
|
|
|
|
The following plugins remain active and are optimized:
|
|
|
|
1. **Tdarr_Plugin_00_file_audit.js** - Read-only diagnostic plugin (unique purpose)
|
|
2. **Tdarr_Plugin_01_container_remux.js** - Container remuxing with timestamp fixes (optimized)
|
|
3. **Tdarr_Plugin_02_stream_cleanup.js** - Stream removal (already efficient)
|
|
4. **Tdarr_Plugin_03_stream_ordering.js** - Stream reordering by language (well-structured)
|
|
5. **Tdarr_Plugin_04_subtitle_conversion.js** - Subtitle codec conversion (efficient)
|
|
6. **Tdarr_Plugin_05_subtitle_extraction.js** - External subtitle extraction (efficient)
|
|
7. **Tdarr_Plugin_06_cc_extraction.js** - Closed caption extraction (efficient)
|
|
8. **Tdarr_Plugin_av1_svt_converter.js** - AV1 video conversion (unique purpose)
|
|
9. **Tdarr_Plugin_combined_audio_standardizer.js** - Audio standardization (unique purpose)
|
|
|
|
## Plugin Architecture
|
|
|
|
The remaining plugins follow a **modular, single-responsibility** design:
|
|
|
|
- **00**: Diagnostic/audit (read-only)
|
|
- **01-06**: Sequential processing pipeline (container → cleanup → ordering → subtitles)
|
|
- **AV1/Audio**: Specialized conversion plugins
|
|
|
|
## Benefits
|
|
|
|
1. **Reduced Redundancy**: Eliminated duplicate functionality
|
|
2. **Better Maintainability**: Clear separation of concerns
|
|
3. **Improved Performance**: Optimized stream processing loops
|
|
4. **Bug Fixes**: Removed broken code (misc_fixes undefined variable)
|
|
5. **Cleaner Codebase**: Focused, purpose-built plugins
|
|
|
|
## Verification
|
|
|
|
- ✅ All remaining plugins pass linter checks
|
|
- ✅ No syntax errors
|
|
- ✅ Plugins follow consistent patterns
|
|
- ✅ Early exit optimizations in place
|
|
- ✅ Efficient Set-based lookups for codec checks
|
|
|
|
## Recommendations
|
|
|
|
1. **Use the numbered plugins (00-06)** in sequence for a complete processing pipeline
|
|
2. **Avoid using archived plugins** - they are redundant and/or have bugs
|
|
3. **Plugin order matters**: Follow the numbered sequence for best results
|
|
|
|
## Archive Location
|
|
|
|
Redundant plugins are preserved in:
|
|
```
|
|
agent-notes/archived/
|
|
├── Tdarr_Plugin_misc_fixes.js
|
|
└── Tdarr_Plugin_stream_organizer.js
|
|
```
|
|
|
|
These can be referenced for historical purposes but should not be used in production.
|