Skip to content

feat(games): add IGDB completion-time estimates - #160

Merged
Kyonew merged 1 commit into
Kyonew:release/3.2.0from
Siebe-Uy:feat/game-completion-time-estimate
Sep 16, 2026
Merged

Kyonew merged 1 commit into
Kyonew:release/3.2.0from
Siebe-Uy:feat/game-completion-time-estimate

Conversation

@Siebe-Uy

@Siebe-Uy Siebe-Uy commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Closes #140

Adds estimated time-to-beat for games (Rushed / Normal / Completionist, in hours) using IGDB's own game_time_to_beats endpoint — 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 fetches game_time_to_beats for 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 into refreshItem so 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 --noEmit clean 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.

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
@Kyonew
Kyonew changed the base branch from main to release/3.2.0 September 16, 2026 16:43
@Kyonew
Kyonew merged commit eb4d003 into Kyonew:release/3.2.0 Sep 16, 2026
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.

[Feature]: Playtime for Video Games

2 participants