Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Auto detect text files and perform LF normalization
* text=auto
db/static/content/** -text
140 changes: 0 additions & 140 deletions .github/workflows/generate-database.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,6 @@ concurrency:
cancel-in-progress: true

jobs:
python-tests:
name: Python tests (db/)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: db/requirements.txt

- name: Install runtime + test deps
run: pip install -r db/requirements.txt pytest

- name: Build MiNERVA test fixture
working-directory: db
run: python tests/fixtures/build_minerva_fixture.py

- name: Run pytest
working-directory: db
run: python -m pytest tests -v

flutter-analyze:
name: Flutter analyze
runs-on: ubuntu-latest
Expand Down
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,9 @@ The built APK will be located at `build/app/outputs/flutter-apk/app-release.apk`

Release builds are filtered to **arm64-v8a** to keep the APK size sane after bundling the BitTorrent runtime. Every modern Android phone and retro handheld is arm64. To produce a 4-ABI build, edit `abiFilters` in `android/app/build.gradle.kts`.

### Rebuild the catalog database (optional)
### The catalog database

The app pulls a pre-built SQLite catalog from this repo. CI rebuilds it weekly. If you want to run the build locally:

```bash
cd db
pip install -r requirements.txt
python workflow.py # full rebuild
python workflow.py --use-cached # reuse cached HTTP responses
python workflow.py --skip-minerva # skip the ~1.7 GB MiNERVA mirror download
```

Output is `db/romdb.db`. Adding a new source = drop a folder under `db/sources/<id>/` with `source.yml` + `scraper.py` and add the platform routes in `db/platforms.yml`.
The app pulls a pre-built SQLite catalog from this repo, updated weekly. `db/CATALOG.md` documents the artifact format. The catalog is provided for use in romgi; forks and derivative tools are not supported.

## Technical Details

Expand Down
32 changes: 4 additions & 28 deletions db/.gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
# Cached HTTP responses
# Local pipeline leftovers, not part of the published artifacts
cache/

# Downloaded metadata files
data/

# Generated static files (PS3/PSV)
static/

# Uncompressed database (only commit the .gz)
secrets/
*.db
!romdb.db.gz

# Temp files
*.db-journal
*_temp.db
*_old.db

# Python
__pycache__/
*.py[cod]
*$py.class
.Python
*.so
.env
venv/
ENV/

# Config files (use examples instead)
config.json

# Credentials (never commit)
*_creds.json
secrets/
scrapers/
static/
45 changes: 45 additions & 0 deletions db/CATALOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Catalog format

The app downloads these artifacts from this directory on `main`:

| File | Purpose |
|---|---|
| `version.json` | Catalog metadata, checked before download |
| `romdb.db.gz` | Gzipped SQLite database |
| `static/content/ps3/raps/*.rap` | PS3 license files, referenced by catalog URLs |
| `static/content/psv/zrifs/*.txt` | PSVita zRIF keys, referenced by catalog URLs |

## version.json

```json
{
"version": "20260904",
"generated_at": "2026-09-04T15:00:00Z",
"schema_version": 4,
"min_app_version": "1.2.0",
"size": 55424693,
"uncompressed_size": 345706496,
"entries": 241126,
"links": 400298,
"platforms": 50,
"sources": 4,
"retroachievements": 9576
}
```

`schema_version` bumps trigger a wipe-and-redownload in the app. `min_app_version` gates catalogs that need newer app features.

## Database schema (v4)

- `platforms(id, brand, name)`
- `entries(slug PK, rom_id, search_key, title, platform, boxart_url, ra_game_id, ra_num_achievements)`
- `entries_fts` — FTS4 over `search_key`, `tokenize=unicode61`
- `regions(id, name)` / `regions_entries(entry, region)`
- `sources(id PK, name, homepage, kind, auth_required, priority, manifest_json)`
- `source_health(source_id PK, status, last_checked, reason, entry_count, link_count)`
- `user_sources(id, name, kind, config_json, created_at)` — app-owned, empty in published catalogs
- `torrents(infohash PK, source_id, name, magnet, torrent_blob, total_size, piece_length, file_count, trackers_json, added_at)`
- `links(entry, name, type, format, url, filename, host, size, size_str, source_url, source_id, requires_auth, torrent_infohash, torrent_file_index, torrent_file_path)`
- `entry_groups(id PK, kind, title, platform, member_count, metadata_json)` / `entry_group_members(group_id, entry, member_index, member_label)` — multi-disc grouping

Indexes: `idx_entries_platform` on `entries(platform)`, `idx_entry_groups_kind` on `entry_groups(kind)`.
23 changes: 0 additions & 23 deletions db/core/__init__.py

This file was deleted.

Loading