Metadata-Version: 2.4
Name: mediahive
Version: 0.3.0
Summary: MediaHive - Media scanning, indexing, and Netflix-style streaming
Project-URL: Repository, https://git.zi.fi/LeoVasanko/mediahive
Requires-Python: >=3.14
Requires-Dist: aiofiles>=25.1.0
Requires-Dist: aiopathlib>=0.6.0
Requires-Dist: bencodepy>=0.9.5
Requires-Dist: fastapi-vue>=0.5.2
Requires-Dist: fastapi[standard]>=0.128.0
Requires-Dist: httpx[http2]>=0.28.1
Requires-Dist: msgspec>=0.19
Requires-Dist: parse-torrent-title>=2.8.1
Requires-Dist: tomli-w>=1.2.0
Requires-Dist: uvicorn[standard]>=0.40.0
Provides-Extra: gui
Requires-Dist: pyinstaller>=6.0; extra == 'gui'
Requires-Dist: pythonnet>=3.1.0rc0; (platform_system == 'Windows' and python_version >= '3.14') and extra == 'gui'
Requires-Dist: pywebview>=6.2.1; extra == 'gui'
Description-Content-Type: text/markdown

# MediaHive

Media scanning, indexing, and Netflix-style web streaming for your torrent collection.

**[Windows portable ZIP download](https://git.zi.fi/LeoVasanko/mediahive/releases)**

## Project Structure

```
hivescan/               Indexing & previews (library + CLI)
  indexer.py              Media index generation
  scanning.py             File system scanning
  parsing.py              Torrent name parsing (PTN)
  models.py               Data models
  images.py               TMDb cover/backdrop downloading
  showreel.py             Video preview clip generation (ffmpeg)
  tmdb_client.py          TMDb API client with caching
  utils.py                Path, size, and timestamp helpers
mediahive/              FastAPI web server + Vue frontend
  server.py               FastAPI app (API + media serving)
  __main__.py             CLI entry point
frontend/               Vue 3 frontend source
  src/
    components/           Vue components (Netflix-style UI)
    styles/               CSS styles
    api.ts                API calls to FastAPI backend
    types.ts              TypeScript interfaces
scripts/
  devserver.py            Development server (Vite + FastAPI)
  rtorrent-manager.py     Torrent scanning & rtorrent management
  fastapi-vue/            Build utilities for frontend
rtorrent_client.py      RTorrent XMLRPC/SCGI client
```

## Quick Start

```bash
pip install -e .
```

### 1. Scan & Index Media

```bash
# Scan downloads, auto-detect common root, create .mediahive folder
hivescan /media/torrents/*

# Scan multiple locations
hivescan /mnt/disk1/* /mnt/disk2/*

# Override output directory
hivescan /media/torrents/* -o /srv/media/.mediahive

# Skip cover/showreel generation
hivescan /media/torrents/* --no-covers --no-showreels
```

### 2. Serve & Browse

```bash
# Start the web server
mediahive /path/to/your/media/folder

# Server starts at http://localhost:8420
```

The app expects `<media-folder>/.mediahive/index.json` generated by hivescan.

### 3. Development

```bash
cd frontend && npm install && cd ..
python scripts/devserver.py
```

Starts Vite dev server + FastAPI backend with auto-reload.

## API Endpoints

- `GET /api/index` — Load media index
- `POST /api/play` — Open media file with system player
- `POST /api/open-folder` — Open folder in file explorer
- `GET /api/media/{path}` — Serve media files (images, video)

## RTorrent Manager

```bash
python scripts/rtorrent-manager.py /media/torrents*/.torrents/
```

Scans `.torrent` files, verifies downloads exist, loads into rtorrent.

## Requirements

- Python ≥ 3.14
- Node.js 18+ (frontend development)
- ffmpeg (showreel generation)
