Skip to content

Show playtime by original game and recomp - #251

Merged
elripalda merged 5 commits into
elripalda:mainfrom
Lui35:feat/game-first-playtime
Nov 16, 2026
Merged

elripalda merged 5 commits into
elripalda:mainfrom
Lui35:feat/game-first-playtime

Conversation

@Lui35

@Lui35 Lui35 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Show total playtime for the original game across recomps grouped under the same catalog game ID.
  • Show each recomp’s own playtime on its game page and in the desktop Versions list.
  • Preserve playtime, last-played date, and session history on uninstall. Restore that history on reinstall without counting it twice.

This covers local playtime for #210. Cross-device sync and community statistics remain open.

Verification

  • 270 JavaScript tests passed.
  • 616 Rust tests passed, including coverage for retaining playtime through reinstall.

@Xarishark
Xarishark marked this pull request as draft November 16, 2026 19:57
@Xarishark

Xarishark commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Was a draft until the backend was ready. It's live now, so this is ready for review.

Added on top of the original commit:

  • Play history follows a project rename, and restoring it adds to the time a game already has instead of replacing it.
  • Translations for the two new labels.
  • Playtime synced with the account: signed in, each PC sends its own time per game (everything after signing in and once a day, one game after each session), and game pages show the totals over all the account's PCs. Signed out, or if the site can't answer, it shows this PC's own numbers. These calls never sign the PC out. Documented in docs/LAUNCHER-API.md (Playtime).
  • tools/fake-play-site.cjs, a stand-in website for trying this locally with RL_API.

Tested on Windows with two portable launchers against the fake site: sign-in send, a real session, two PCs adding up, uninstall plus resend (no double count), and the fallback when the site refuses the call. cargo test 623 passed, node tests 275 passed.

Reinstalling now adds the kept time to whatever the record already has instead of replacing it, and a renamed project takes the history kept under its old id.
tools/fake-play-site.cjs signs a launcher in to a fake account and answers the playtime calls as recomplauncher.com does, passing everything else through to the real site. --no-play answers them the way a site without them does.
Signed in, each PC sends its own time per game to recomplauncher.com (everything after signing in and once a day, one game after each session) and game pages show the totals over all the account's PCs. Signed out, or when the site can't say, it's this PC's own numbers. These calls never sign the PC out and rest on their own.
@Xarishark
Xarishark marked this pull request as ready for review November 16, 2026 22:10
@elripalda
elripalda merged commit c4d9f3a into elripalda:main Nov 16, 2026
5 checks passed
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.

3 participants