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:
2026-01-07 17:43:09 +00:00
commit a8b247a83f
25 changed files with 2962 additions and 0 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies for paramiko
RUN apt-get update && apt-get install -y --no-install-recommends \
openssh-client \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY src/ ./src/
COPY pyproject.toml .
# Install the application
RUN pip install --no-cache-dir .
# Create data directory for state persistence
RUN mkdir -p /app/data
# Create .ssh directory for keys (owned by runtime user 1000:1000)
RUN mkdir -p /app/.ssh && chmod 700 /app/.ssh && chown 1000:1000 /app/.ssh
ENV PYTHONUNBUFFERED=1
ENV STATE_FILE=/app/data/state.json
ENV SSH_KEY_PATH=/app/.ssh/id_rsa
CMD ["python", "-m", "tvh2jellyfin.main"]