44 lines
1.7 KiB
Markdown
44 lines
1.7 KiB
Markdown
# CLAUDE.md
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
## Project Overview
|
|
|
|
Lutris Year in Review is a Python script that generates a static HTML playtime report from a Lutris gaming platform SQLite database. The report displays game playtime statistics with interactive Chart.js visualizations.
|
|
|
|
## Commands
|
|
|
|
Generate report with defaults:
|
|
```bash
|
|
python generate_report.py
|
|
```
|
|
|
|
Generate report with custom options:
|
|
```bash
|
|
python generate_report.py --db pga.db --output report.html --top 10 --background background.png
|
|
```
|
|
|
|
## Architecture
|
|
|
|
**Single-file generator (`generate_report.py`):**
|
|
- Reads Lutris SQLite database (`pga.db`) containing games, categories, and playtime data
|
|
- Embeds all data (games JSON, background image as base64) directly into a self-contained HTML file
|
|
- HTML template with Chart.js doughnut chart and dynamic JavaScript filtering is embedded as a string constant (`HTML_TEMPLATE`)
|
|
|
|
**Database schema (`schema.py`):**
|
|
- Reference file documenting Lutris database structure
|
|
- Key tables: `games` (with `playtime`, `service` fields), `categories`, `games_categories` (many-to-many join)
|
|
|
|
**Generated output (`report.html`):**
|
|
- Fully static, can be hosted on any web server
|
|
- Client-side filtering by service (Steam, GOG, itch.io, local)
|
|
- Expandable "Others" row in games table
|
|
- Light/dark mode support via CSS `prefers-color-scheme`
|
|
|
|
## Key Data Relationships
|
|
|
|
- Games have a `service` field (steam, gog, itchio, humblebundle, or NULL for local)
|
|
- Games link to categories via `games_categories` join table
|
|
- Categories like `.hidden`, `favorite`, `Horny` are filtered out in the report
|
|
- `playtime` is cumulative hours (REAL), not per-session data
|