Initial commit: TVH2Jellyfin application
A Docker-based Python application that transfers completed recordings from TVHeadend to Jellyfin media storage via SCP. Features: - Monitors TVHeadend for completed recordings via JSON API - Transfers files via SCP with SSH key authentication - Organizes files by show name - Deletes recordings from TVHeadend after successful transfer - Tracks transferred files to avoid duplicates - Dry run mode for testing without making changes
This commit is contained in:
42
CLAUDE.md
Normal file
42
CLAUDE.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Build & Development Commands
|
||||
|
||||
```bash
|
||||
# Install for development
|
||||
pip install -e ".[dev]"
|
||||
|
||||
# Run the application
|
||||
python -m tvh2jellyfin.main
|
||||
|
||||
# Run tests
|
||||
pytest
|
||||
|
||||
# Run single test
|
||||
pytest tests/test_file.py::test_function
|
||||
|
||||
# Lint
|
||||
ruff check src/
|
||||
|
||||
# Format
|
||||
ruff format src/
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
This application transfers TV recordings from a remote TVHeadend server to a local Jellyfin media library.
|
||||
|
||||
**Data Flow:**
|
||||
1. `tvheadend.py` - Queries TVHeadend JSON API for completed recordings
|
||||
2. `transfer.py` - Downloads files via SCP from TVHeadend server to local destination
|
||||
3. `organizer.py` - Generates destination paths organized by show name
|
||||
4. `state.py` - Tracks transferred recordings (JSON file) to avoid duplicates
|
||||
5. `main.py` - Orchestrates the sync loop with scheduling
|
||||
|
||||
**Key Design Decisions:**
|
||||
- SCP pulls files FROM TVHeadend (source is remote, destination is local Docker volume)
|
||||
- TVHeadend API used for both discovery (grid_finished) and cleanup (remove after transfer)
|
||||
- Dry run mode skips SSH connection and all mutations
|
||||
- State persisted as JSON for Docker volume compatibility
|
||||
Reference in New Issue
Block a user