Skip to content

feat: Unknown titles & metadata override management#250

Closed
HarleyBartles wants to merge 53 commits intoa1ex4:developfrom
HarleyBartles:unknown-titles-on-develop
Closed

feat: Unknown titles & metadata override management#250
HarleyBartles wants to merge 53 commits intoa1ex4:developfrom
HarleyBartles:unknown-titles-on-develop

Conversation

@HarleyBartles
Copy link
Copy Markdown
Contributor

@HarleyBartles HarleyBartles commented Oct 14, 2025

App Overrides and Metadata Editing Overhaul

This pull request introduces a comprehensive upgrade to Ownfoil’s metadata system, focusing on user-driven metadata editing and improved DLC recognition.

Admin users can now edit, correct, and personalize title metadata directly from the main Library view — including for titles that are not recognized by the global TitleDB.
Shop users then benefit from the customized metadata in Ownfoil's web UI and in the Tinfoil shop.


Key Features

App Overrides

  • Adds a new AppOverrides database model and API (/api/overrides) to store custom metadata for individual apps (base or DLC).
  • Supports overriding:
    • Title name
    • Description
    • Release date
    • Banner and icon artwork (via upload)
    • Corrected Title ID (for fixing mismatched or incorrect identifiers)
  • Uploaded artwork automatically generates its counterpart (e.g. uploading a banner creates an icon, or vice versa) intelligently while preserving the original images.
  • Possible to upload one image and let the backend fill both slots or optionally upload two different images for icon & banner.

Override Isolation

All edits apply strictly to override data only.
The underlying TitleDB entries and scanned library metadata remain untouched.
This ensures user modifications are non-destructive and can be safely reverted at any time.

Title ID Correction and DLC Metadata Resolution

  • Adds support for overriding an incorrect Title ID directly in an override.
  • Corrected Title IDs now propagate cleanly through:
    • The web UI (highlighted as corrected)
    • Library generation and recognition logic
    • The Tinfoil shop feed (ensuring corrected entries appear properly in Tinfoil)
  • Fixes DLC metadata resolution: DLCs now pull metadata from TitleDB using their own app-specific Title IDs, instead of inheriting from the base game.
  • DLC cards and override modals now display the DLC’s own Title ID, not the base ID.

Override Editor UI

  • Integrates an inline Override Editor directly into the Library interface.
  • Click the edit button on any title card to modify or reset metadata in place.
  • Works for both:
    • Unrecognized titles (missing from TitleDB)
    • Recognized titles where you prefer custom or localized metadata
  • The edit button visually reflects whether an override is active (btn-success when active).
  • Editing overrides requires admin authentication.
    • Override GET endpoints require shop auth.
    • POST, PUT, PATCH, and DELETE endpoints require admin auth.

Instant Feedback

  • Edits apply immediately without a page reload.
  • Artwork updates propagate instantly using cache-busting to prevent stale thumbnails.
  • Resetting an override reverts all fields and artwork to defaults.

Smarter Filtering

  • Adds new filters to the Library view:
    • Unrecognized – shows titles missing from TitleDB
    • Overridden – shows titles with active overrides
  • Filtering works for both admin and shop users (no admin requirement for read-only access).

Tinfoil Integration

  • Overrides propagate into Tinfoil via the titledb node in the shop feed.
  • Enables Ownfoil users to:
    • Add missing metadata for homebrew or unrecognized titles
    • Override or translate metadata for localized libraries
    • Fix incorrect or mismatched Title IDs so Tinfoil correctly categorizes entries
  • Tinfoil reflects all overridden metadata from the Ownfoil library (excluding images, which Tinfoil doesn’t support yet).

Artwork Handling Improvements

  • Adds dedicated upload directories for banners and icons:
    /uploads/banners
    /uploads/icons
    
  • Implements cross-derivation logic to auto-generate a missing counterpart image.
  • Uses consistent placeholder images and centralized default definitions.

Technical Improvements

  • Refactors titles.py, library.py, and shop.py for cleaner separation between library generation and override application.
  • Simplifies and stabilizes get_shop_files() to focus purely on file listing.
  • Adds consistent UTC timestamps across DB operations.
  • Enhances Title ID lookup, recognition logic, and DLC metadata handling.
  • Extracts all override logic into a standalone JS module:
    /static/js/overrides.js
    
  • Injects only the minimal required globals into the page, with the module exposing its own clean window.Overrides API.

Real-World Benefits

  • Fix metadata for homebrew or unrecognized titles.
  • Correct incorrect Title IDs, including DLCs.
  • Translate or rename titles for localized libraries.
  • Keep Tinfoil fully populated with accurate, override-enhanced metadata.
  • Perform edits safely without altering the base database or TitleDB entries.
  • Enjoy a smoother and faster admin workflow with immediate visual feedback.

Migration Notes

  • New Alembic migration adds the app_overrides table:
    flask db upgrade
  • Required directories:
    /data/uploads/banners
    /data/uploads/icons
    
    Created automatically if missing.
  • Existing library and TitleDB remain fully compatible.

Known Gaps

  • Overridden artwork does not yet propagate to Tinfoil (Tinfoil limitation).
  • Optional fields like “rank” and “publisher” are not included in the feed, pending future relevance.

Summary

This update transforms Ownfoil into an editable metadata manager with per-app (base or DLC) overrides.
It resolves longstanding DLC metadata issues, ensures accurate Title ID handling, and gives admins direct, real-time control over library information.
Ownfoil instances can now fully correct, localize, and manage their own metadata without reliance on external TitleDB entries.

@HarleyBartles
Copy link
Copy Markdown
Contributor Author

Let me know if you require any changes, I'm happy to make them. Or feel free to tweak as you see fit.

@HarleyBartles HarleyBartles changed the title implement unknown titles override management feat:unknown titles override management Oct 14, 2025
@HarleyBartles HarleyBartles changed the title feat:unknown titles override management feat: Unknown titles & metadata override management Oct 14, 2025
@HarleyBartles
Copy link
Copy Markdown
Contributor Author

HarleyBartles commented Oct 14, 2025

Closes #239 #158 and #168

@HarleyBartles
Copy link
Copy Markdown
Contributor Author

HarleyBartles commented Oct 14, 2025

Related to #112 and #243

@HarleyBartles
Copy link
Copy Markdown
Contributor Author

HarleyBartles commented Oct 19, 2025

Fixed DLC metadata resolution. DLC cards now show the metadata for the DLC instead of just inheriting the base title's metadata

image image image

@HarleyBartles
Copy link
Copy Markdown
Contributor Author

HarleyBartles commented Oct 20, 2025

Ok, I think I'm finally finished messing with this.

I moved the overridden title id metadata resolution to the overrides api (no longer polluting the titles api) and added server caching (same as library.json) and etag caching so that the overrides json is not even returned if the browser already cached the same version.

Let me know if you'd prefer a clean PR with one commit, I can do that if it's easier. Or I could probably separate a few things out into their own standalone PR's if you think there's too much in this one. If I spot anything wrong I'll push to this branch, otherwise this PR is ready for review.

@HarleyBartles HarleyBartles force-pushed the unknown-titles-on-develop branch from 5d7b8b1 to a0db464 Compare October 21, 2025 22:23
@HarleyBartles
Copy link
Copy Markdown
Contributor Author

Closing this PR for now. I'll re-create it with a much cleaner commit history.

@HarleyBartles
Copy link
Copy Markdown
Contributor Author

Superceded by #262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant