feat(games): add IGDB completion-time estimates - #160
Merged
Kyonew merged 1 commit intoSep 16, 2026
Merged
Conversation
Pulls IGDB's own time-to-beat data (hastily/normally/completely, in hours) for a game on confirm and on metadata refresh, and shows it on the detail page next to the status/rating blocks. Nothing is fabricated for a game IGDB hasn't timed yet: the block, or an individual estimate, is simply omitted. Closes Kyonew#140
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.
Closes #140
Adds estimated time-to-beat for games (Rushed / Normal / Completionist, in hours) using IGDB's own
game_time_to_beatsendpoint — the same hastily/normally/completely data HowLongToBeat shows, sourced through the API games already authenticates against, so no new dependency and no scraping.What changed
plugins/games/igdb.ts:getDetails()now also fetchesgame_time_to_beatsfor the game and converts seconds to hours (best-effort — a failed/missing lookup never breaks confirm/refresh, it just leaves the estimate blank).plugins/games/index.ts: three new schema fields (completionHastily,completionNormally,completionCompletely); wired intorefreshItemso existing library items can backfill on next refresh (falling back to the stored value on a transient miss); new sidebar detail zone.plugins/games/partials/completion-times.ejs: read-only block on the detail page, next to Status/Rating. Only renders the estimates IGDB actually returned — nothing fabricated for a game nobody has timed. Fixed at 2 columns to match the Status/Rating row's width regardless of how many of the three values are present.locales/en.json+locales/fr.json: new labels.Not included
Per-user logged playtime / multiple playthroughs (also mentioned in #140) — this PR only covers the estimated time-to-beat. Happy to follow up separately if wanted.
Testing
npx tsc --noEmitclean on all changed files. Manually verified in a local Docker stack (existing Hollow Knight seed item): refreshing metadata populates the estimates, and the detail page block matches the Status/Rating row's width whether 1, 2, or 3 estimates are present.