How haveagitgat/tdarr works
Project Type & Purpose
• Tdarr V2 is a full-stack, distributed media processing application. It is entirely focused on automating the process of transcoding and remuxing media files using both community and locally developed plugins.
• The README outlines that there are two key processes: Tdarr_Server (the central coordinator) and Tdarr_Node (the worker that actually processes media files). It also highlights integration with transcoding tools like FFmpeg and HandBrake and emphasizes modularity (via plugin stacks).
Analyzing the File Structure
• Top-Level Directories: Notice directories like “docker” (for container definitions and setup), “updater”, and configuration files such as “package.json”. The presence of a .github directory indicates automated builds, CI configuration, and issue templates.
• The docker folder contains multiple Dockerfiles and setup scripts (e.g., in docker/root/etc) which indicate that Docker containers are used to deploy the different components (server and nodes).
• There are clear separation of responsibilities—with updater scripts and container definitions—suggesting that the system is modular with specific subsystems for different functions, including orchestration and plugin management.
Key Components to Capture
a. Tdarr_Server:
• Central process that all nodes communicate with.
• Responsible for scheduling, task distribution, configuration, library management, job reports, plugin stack management, and user interface (via the click-to-run web app).
b. Tdarr_Node:
• Worker processes that run on the same or different devices.
• They connect to the Tdarr_Server to fetch transcoding or health-check tasks.
• Different types of workers are mentioned (CPU/GPU for transcode and health check).
c. Media Transcoding Engines:
• External tools like FFmpeg and HandBrake which are integrated within nodes.
• These tool integrations should be represented as part of the nodes’ process pipeline.
d. Docker & Deployment:
• Docker configurations indicate that each component can be deployed in containers.
• Docker environment, the Dockerfile build process, and any orchestration that might be implied.
e. Plugin System:
• Plugin stack mechanism that dynamically determines actions based on conditional rules.
f. External Integrations:
• Potential integrations with applications like Sonarr/Radarr for media management.
Relationships & Data Flow
• From the Tdarr_Server to Tdarr_Node, indicating task assignment and health monitoring.
• From media files and library input (imagine a media library source) into the Tdarr_Server.
• From the nodes to external transcoding engines (FFmpeg/HandBrake) to show the actual processing.
• Between the plugin layer and the media pipelines (indicate conditional decision making for executing plugin actions such as transcoding, remuxing, and metadata adjustments).
• That the Server gets results back from the Nodes (job reports, stats, worker verdict history).
Architectural Patterns & Design Principles
• Modularity: Emphasize the separation between the central server and worker nodes. The plugin architecture also reinforces modularity by allowing new filters and actions.
• Scalability & Parallel Processing: With Nodes that can be spun up or down, highlight the load balancing and scheduling mechanism, enabling scalability.