feat: integrate Wikidata awards system and enhance metadata management - #223
Merged
Merged
Conversation
This commit introduces a comprehensive awards tracking system powered by Wikidata, allowing users to view detailed win and nomination histories for movies, shows, and people. It includes a robust caching layer, SPARQL-based query infrastructure, and a new UI suite for timeline-style award displays.
### Key Changes:
* **Wikidata Integration**:
* **Networking**: Added `WikidataApiService` and `WikidataAwardQueries` to perform SPARQL lookups using TMDB identifiers.
* **Parsing**: Implemented `WikidataAwardParser` to transform complex SPARQL responses into a unified `WikidataAwards` model, featuring logic to group results by year and deduplicate "Won" vs. "Nominated" entries.
* **Repository**: Created `WikidataAwardsRepository` to manage data flow, handle in-flight request de-duplication, and manage multi-tier TTL (Time-To-Live) for positive and negative caches.
* **Persistence & Caching**:
* **Database**: Introduced `WikidataAwardsCacheEntity` and `WikidataAwardsDao` with a Room migration (v70 to v71).
* **Metadata Refactoring**: Updated `ItemDetailViewModel` to use differentiated cache expiration (48h for populated metadata vs. 6h for empty results) to improve refresh reliability.
* **UI & Presentation**:
* **`WikidataAwardsSection`**: Created a new UI component supporting two styles: a `COLLAPSED_BAR` for item headers and an `OPEN_LIST` for detailed timelines.
* **Award Timeline**: Implemented a vertical timeline view with distinct markers for wins (gold) and nominations, including a bottom sheet for full history.
* **Person Support**: Extended person detail screens to fetch and display awards for actors and directors by resolving their TMDB IDs.
* **Preferences**: Added global toggles for "Show Awards" and "Wikidata Enabled," including a dedicated disclosure and opt-in flow in the Services Hub.
* **Security & Utilities**:
* **URL Redaction**: Introduced `UrlRedaction.kt` to automatically strip sensitive parameters (API keys, tokens) from logs across the network layer and media workers.
* **MDBList Usage**: Added an API usage tracker in Settings to show remaining MDBList requests.
* **Refinement**:
* Centralized award headline logic to prioritize OMDb headlines while falling back to derived Wikidata summaries when applicable.
* Updated `PlayerControls` to respect the new `LocalShowAwards` preference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a comprehensive awards tracking system powered by Wikidata, allowing users to view detailed win and nomination histories for movies, shows, and people. It includes a robust caching layer, SPARQL-based query infrastructure, and a new UI suite for timeline-style award displays.
Key Changes:
Wikidata Integration:
WikidataApiServiceandWikidataAwardQueriesto perform SPARQL lookups using TMDB identifiers.WikidataAwardParserto transform complex SPARQL responses into a unifiedWikidataAwardsmodel, featuring logic to group results by year and deduplicate "Won" vs. "Nominated" entries.WikidataAwardsRepositoryto manage data flow, handle in-flight request de-duplication, and manage multi-tier TTL (Time-To-Live) for positive and negative caches.Persistence & Caching:
WikidataAwardsCacheEntityandWikidataAwardsDaowith a Room migration (v70 to v71).ItemDetailViewModelto use differentiated cache expiration (48h for populated metadata vs. 6h for empty results) to improve refresh reliability.UI & Presentation:
WikidataAwardsSection: Created a new UI component supporting two styles: aCOLLAPSED_BARfor item headers and anOPEN_LISTfor detailed timelines.Security & Utilities:
UrlRedaction.ktto automatically strip sensitive parameters (API keys, tokens) from logs across the network layer and media workers.Refinement:
PlayerControlsto respect the newLocalShowAwardspreference.