Skip to content

feat: split company metadata into publishers and developers - #3898

Open
gantoine wants to merge 1 commit into
masterfrom
feat/publisher-developer-split
Open

feat: split company metadata into publishers and developers#3898
gantoine wants to merge 1 commit into
masterfrom
feat/publisher-developer-split

Conversation

@gantoine

Copy link
Copy Markdown
Member

Description

Metadata providers (ScreenScraper, RetroAchievements, LaunchBox, Flashpoint, gamelist, IGDB) distinguish the publisher from the developer of a game, but RomM amalgamates both into a single companies list at ingestion, so the distinction is unrecoverable (which breaks round-tripping to tools like LaunchBox/Pegasus where it matters to collectors).

This threads two new refined fields, publishers and developers, end to end. companies is kept unchanged as the merged union, so nothing existing breaks; the split is purely additive.

Backend

  • Handlers now emit publishers/developers alongside the unchanged companies list (ss, ra, launchbox, flashpoint, gamelist, igdb, hasheous). IGDB requests the involved_companies.developer/.publisher flags to split by role.
  • Migration 0102 adds generated_publishers/generated_developers STORED columns on roms, projects them through the roms_metadata view (appended, so nothing shifts), mirrors them into roms_facets, and adds publisher/developer virtual-collection types. All triggers/functions rebuilt for MariaDB/MySQL + PostgreSQL; upgrade/downgrade round-trips and live trigger-sync verified.
  • Filters, facets, endpoints, smart collections, and the gamelist/Pegasus exporters all carry the new fields. The exporters now prefer the explicit split and fall back to the old companies[0]/[1] heuristic for ROMs scanned before the split.

Frontend (v2)

  • Shared filter store + API service, gallery filter drawer, URL persistence, game-detail display (shows Developers/Publishers, falls back to the merged Companies), edit dialog, smart-collection criteria, and a publisher/developer "group virtual collections by" option.
  • Also relabels the confusing company → "Developer" group-by option to "Company" now that a proper Developer option exists.
  • 4 new i18n keys added to all 18 locales (non-English get English placeholders pending community translation).

Notes

  • Existing libraries only populate companies until ROMs are re-scanned (the split reads raw provider blobs that predate the new keys). companies stays fully populated meanwhile.
  • Scoped new UI to v2 per the repo's "v1 is frozen" rule; v1 keeps companies as-is.

AI-assistance disclosure

This PR was implemented with substantial assistance from Claude (Claude Code). AI was used to map the companies data flow, write the migration and the handler/schema/filter/frontend changes, and author the tests. All changes were reviewed and verified locally by the author.

Checklist

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Testing

  • Backend: alembic upgrade head/downgrade -1 round-trip on MariaDB; 906 passed / 2 skipped across handler/database/metadata/utils/endpoints (incl. new generated-column, facets, and exporter tests).
  • Frontend: vue-tsc typecheck clean, vitest green (incl. new smart-collection criteria tests), npm run generate regenerated types, i18n parity + sorted checks pass.
  • Trunk clean on all changed files.

Metadata providers (ScreenScraper, RetroAchievements, LaunchBox,
Flashpoint, gamelist, IGDB) distinguish the publisher from the developer
of a game, but RomM amalgamated both into a single `companies` list at
ingestion, so the distinction was unrecoverable. This adds `publishers`
and `developers` as new, refined fields end to end while keeping
`companies` (the merged union) working exactly as before.

Backend:
- Handlers now emit publishers/developers alongside the unchanged
  companies list; IGDB requests the involved_companies developer/
  publisher flags to split by role.
- Migration 0102 adds generated_publishers/generated_developers columns
  on roms, projects them through the roms_metadata view, mirrors them
  into roms_facets, and adds publisher/developer virtual-collection
  types (triggers/functions rebuilt for MariaDB/MySQL + PostgreSQL).
- Filters, facets, endpoints, smart collections and the gamelist/pegasus
  exporters all carry the new fields; exporters prefer the explicit
  split and fall back to the companies heuristic for un-rescanned ROMs.

Frontend (v2):
- Shared filter store + API service, gallery filter drawer, URL
  persistence, game detail display (Developers/Publishers with a
  Companies fallback), edit dialog, smart-collection criteria, and a
  publisher/developer "group virtual collections by" option.
- Also relabels the confusing "company"->"Developer" group-by option
  to "Company" now that a proper Developer option exists.

Fixes #3518

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 23, 2026 11:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds distinct publisher and developer metadata throughout the application while preserving the existing merged companies field.

  • Extends metadata-provider mappings, generated database metadata, facets, filters, smart collections, and virtual collections.
  • Adds publisher/developer editing, filtering, URL persistence, grouping, and display support to the v2 frontend.
  • Updates gamelist and Pegasus exporters to prefer explicit role metadata while retaining legacy company fallbacks.
  • Adds backend and frontend tests for generated metadata, facets, exporters, and smart-collection criteria.

Confidence Score: 5/5

The PR appears safe to merge, with the publisher/developer split consistently threaded through persistence, APIs, filtering, exports, and the v2 interface.

The new role fields preserve the existing companies contract, use the established metadata precedence and JSON-filter paths, rebuild dependent database synchronization structures for both supported dialect families, and retain explicit compatibility fallbacks for metadata created before this change.

Important Files Changed

Filename Overview
backend/alembic/versions/0102_publisher_developer_split.py Adds dialect-aware generated columns, metadata-view projections, facet synchronization, and publisher/developer virtual-collection memberships with a coordinated downgrade.
backend/handler/metadata/igdb_handler.py Requests and separates IGDB involved-company publisher and developer roles while retaining the existing companies output.
backend/handler/database/roms_handler.py Extends ROM filtering, facet extraction, and metadata-join selection with publisher and developer fields using the existing JSON-filter semantics.
backend/handler/database/collections_handler.py Threads publisher and developer criteria, including legacy single-value forms, into smart-collection evaluation.
backend/endpoints/roms/init.py Exposes publisher/developer filters and logic operators and correctly treats them as scoped queries for sidecar caching.
backend/utils/gamelist_exporter.py Exports explicit developer and publisher metadata first, falling back to the established legacy company positions.
backend/utils/pegasus_exporter.py Applies the same explicit-role preference and legacy company fallback to Pegasus metadata output.
frontend/src/stores/galleryFilter.ts Adds complete publisher/developer filter state, logic, setters, active-filter detection, and reset behavior.
frontend/src/v2/composables/useGalleryFilterUrl/index.ts Persists and restores publisher/developer selections and logic operators through gallery URLs.
frontend/src/v2/utils/smartCollectionCriteria.ts Includes publisher and developer filters in smart-collection criteria construction and human-readable summaries.
frontend/src/v2/views/GameDetails.vue Displays split role metadata when available and preserves the merged-companies fallback for libraries not yet rescanned.

Reviews (1): Last reviewed commit: "feat: split company metadata into publis..." | Re-trigger Greptile

@gantoine gantoine added the on-hold Pending further research or blocked by another issue label Jul 23, 2026
@gantoine gantoine self-assigned this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on-hold Pending further research or blocked by another issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants