CineSync Documentation

repository·main·Indexed 18 days ago

https://github.com/sureshfizzy/cinesync

A media library management system that uses symbolic links to organize movies and TV shows without duplicating files. Optimized for debrid-based workflows, CineSync provides a modern web interface for automation and monitoring. It features a single-service architecture consisting of a Go-based WebDavHub server, a Python-based MediaHub backend, and a React frontend. Supported platforms include Linux, macOS, and Windows.

Tokens
17.7K
Snippets
68
Records
95
Agent score
63%

What's inside CineSync

  1. Overview of CineSync

    main

    CineSync is a media library management system designed to organize Movies and TV shows. It serves as an alternative to Sonarr and Radarr by automating the organization of media libraries.

    Core Mechanism: CineSync uses symbolic links to create connections from source directories to destination directories based on metadata from TMDb, IMDb, or TVDB. This allows for a structured library without duplicating files or consuming extra disk space.

    Key Capabilities:

    • Automation: Auto-processing of discovered media files.
    • Debrid Integration: Optimized for debrid platforms (Real-Debrid, TorBox) with features like instant RD mounts and integrated repair flows.
    • Content Separation: Automatic categorization for Kids content, 4K media, and Anime.
    • Media Server Integration: Real-time updates for Plex, Jellyfin, and Emby.
  2. Monitor processing via the Real-Time Dashboard

    main

    The CineSync web interface provides a real-time dashboard to track automation activities:

    • Live Statistics: View processing progress and library statistics as they happen.
    • Recent Media Tracking: Automatically tracks and displays recently added content.
    • Processing Queue: Visually monitor current and pending file operations.
  3. How CineSync's real-time monitoring and automation works

    main

    CineSync uses an intelligent monitoring system to automate media library organization. It utilizes filesystem events for Smart File Detection to identify new media instantly and supports an Auto-Processing Mode that can be toggled via the web interface.

    Key automation behaviors include:

    • Initial Smart Scan: Performs a comprehensive library analysis upon startup.
    • Continuous Monitoring: Detects new files using configurable monitoring intervals.
    • Batch Processing: Handles multiple files using parallel processing.
    • Error Recovery: Implements automatic retries with exponential backoff for failed operations.
    • Duplicate Prevention: Uses intelligent deduplication to avoid re-processing the same content.
  4. How CineSync works: Symbolic Linking

    main

    Instead of physically moving or duplicating files, CineSync organizes your library by creating symbolic links from your source directories to your destination directories.

    This approach relies on metadata from providers like TMDb, IMDb, and TVDB to determine the correct structure. This method preserves disk space while enabling advanced organization and metadata-driven library management.

  5. Understand CineSync's single-service architecture

    main

    CineSync operates using a single-service architecture across all platforms, consisting of three main components:

    1. Main Process: WebDavHub (a Go server) which serves the embedded React frontend.
    2. Subprocess: MediaHub (a Python backend) for media processing.
    3. Frontend: An embedded React application.

    Service Management by Platform

    PlatformService ManagerService NameUser
    WindowsNSSMCineSyncLocalSystem
    Linuxsystemdcinesync.serviceroot
    macOSLaunchAgentcom.cinesync.appcurrent user
  6. CineSync Windows configuration and storage notes

    main

    When running CineSync on Windows, keep the following in mind:

    • Web Interface Port: The default port is 8082. This can be changed using environment variables.
    • Data Storage: The database and log files are stored directly within the installation directory.
    • Process Model: MediaHub operates as a subprocess of the main CineSync service.
  7. Use smart content separation and organization rules

    main

    CineSync can automatically categorize and sort your media based on specific metadata and quality attributes:

    Content Classification

    • Kids Content: Automatically separates family-friendly content based on TMDB ratings (G, PG, TV-Y, TV-G, TV-PG) and family genres.
    • Anime: Specialized handling for anime, separating anime movies from TV shows.
    • 4K/UHD: Automatically detects and separates 4K content into dedicated folders.
    • Resolution-Based Sorting: Sorts content by video quality (e.g., 720p, 1080p, 4K).

    Organization Layouts

    • CineSync Layout: A simplified structure using Movies and Shows directories.
    • Source Structure Preservation: Option to maintain the original folder structures.
    • Custom Folder Naming: Configure specific names for different content types.
    • Collection-Based Grouping: Groups movie franchises and collections together.
  8. Configure media server integration for Plex, Jellyfin, and Emby

    main

    CineSync integrates with major media servers to ensure your library stays updated as files are organized:

    • Jellyfin/Emby: Uses inotify-compatible symlinks to trigger instant library refreshes.
    • Plex: Uses the Plex API to trigger automatic library scanning and updates.
    • Direct Streaming: Organized content becomes available in real-time through these access methods.
  9. Build CineSync for Linux

    main

    To create a Linux installation package, you can build directly on Linux or cross-compile from Windows. The build process compiles the Go WebDAV server, the React frontend, packages the MediaHub Python source via PyInstaller, and downloads the Linux version of rclone.

    Prerequisites:

    • Python 3.8 or higher
    • Go 1.21 or higher
    • Node.js and npm
    • systemd (for service management)
    • fuse3 or fuse (for rclone mounting)
    ### On Linux
    ```bash
    python3 build_installer.py

    Cross-compile from Windows

    python build_installer.py
  10. Install CineSync on Linux

    main

    After building the package, you will find the installation files in the build/ directory. To install, extract the .tar.gz package and run the install.sh script with root privileges. The installer installs the application to /opt/cinesync/, creates a cinesync.service systemd unit, and enables/starts the service.

    # Extract package
    tar -xzf cinesync-linux-amd64.tar.gz
    cd cinesync-linux-amd64
    
    # Run installer (requires root/sudo)
    sudo bash install.sh
  11. Build CineSync for different platforms

    main

    CineSync provides platform-specific build scripts (build_installer.py) that can be run from any operating system to create installers or packages. The build process includes compiling the Go WebDavHub server, building the React frontend, packaging the Python MediaHub, and bundling utilities like rclone and ffprobe.

    Cross-Platform Building Notes

    • Go server and Frontend: Can be cross-compiled from any platform.
    • MediaHub (Python): PyInstaller cross-compilation is not supported. If building for a different platform, the script will package the Python source instead, and the target platform will use a venv to run it.
    • Package creation: All platforms can create packages for all targets.
    ### From Windows (CMD)
    ```cmd/powershell
    # Build for Windows
    cd distribution\windows
    python build_installer.py
    
    # Build for Linux
    cd distribution\linux
    python build_installer.py
    
    # Build for macOS
    cd distribution\macos
    python build_installer.py

    From Linux/macOS (Bash)

    # Build for Linux
    cd distribution/linux
    python3 build_installer.py
    
    # Build for macOS
    cd distribution/macos
    python3 build_installer.py
    
    # Build for Windows
    cd distribution/windows
    python3 build_installer.py