Skip to content

Improved recommendations by using GOG APIs#1676

Draft
utkarshdalal wants to merge 33 commits into
masterfrom
feature/gog-recommendations
Draft

Improved recommendations by using GOG APIs#1676
utkarshdalal wants to merge 33 commits into
masterfrom
feature/gog-recommendations

Conversation

@utkarshdalal

@utkarshdalal utkarshdalal commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Description

Made recommendations more than just a static tile

Recording

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Adds a new GOG‑powered Recommended tab that personalizes picks from your Steam, GOG, Epic, Amazon, and custom games. Also fixes release date display, YouTube trailer playback, and capsule layout on small screens.

  • New Features

    • New RECOMMENDED tab (discover icon, leftmost). Hidden when PrefManager.showRecommendations is off. First open shows a simple disclosure; opting in sets PrefManager.recDisclosureShown. The All-page hero upgrades to a daily GOG pick after consent.
    • Seeds from all owned/played games via GogSeedCollector and a cached map in GogMapRepository (Steam appid, Epic namespace, or normalized title).
    • Recommendations fetched and merged by GogRecommendationsRepository using GOG purchased_together + similar (includes user_id when signed in), ranked across seeds with a GPU five‑star review boost, capped at 200. Store links are wrapped with the CJ affiliate deep link.
    • Cards: GOG rating pill (lazy‑fetched and cached), local‑currency final price with struck base price, and a “matches N of your games” badge. Compatibility and device/GPU run stats included. The All-page hero keeps the old Recommended‑badge style; the new rating/seed badges apply only in the tab.
    • Detail screen: builds a richer RecommendedGame (developer, tags, review score/count). Adds a media carousel with YouTube trailers and screenshots (tap‑to‑play), and clearer descriptions with a GamesDB summary fallback and HTML stripped.
    • Analytics: tab open event, batched card impression event on tab close, and enriched events on open/buy (rank, source, because‑played). Disclosure dialog logs allow/decline. Updated privacy policy and in‑app strings explain data sharing and how to turn recommendations off.
  • Bug Fixes

    • Fixed release date formatting and YouTube trailer playback on the recommendation detail screen.
    • Adjusted capsule grid sizing for compact screens to improve layout.

Written for commit 1daa56f. Summary will update on new commits.

Review in cubic

Utkarsh Dalal added 16 commits July 5, 2026 19:24
New leftmost 'Recommended' library tab (All stays the default tab).
Resolves the user's owned Steam games to GOG via the R2 gog-map.json.gz,
seeds GOG's purchased_together per top game (by device recency then
playtime), merges and ranks across seeds with a 'Because you played X'
caption, and wraps GOG store links in the CJ affiliate deep link.
GOG user_id is included when signed in. The existing single daily
recommendation at the top of All is unchanged.
Gather owned games from Steam (live), GOG, Epic, Amazon (DAOs) and custom
games (scanner). Resolve each to a GOG seed via direct GOG id, Steam appid,
Epic namespace, then a normalized-title fallback (which also recovers AAA
titles whose Steam appid isn't keyed in the map). No Steam sign-in required.
…on tap

- Recommendations now render as LibraryItems through LibraryListPane/
  LibraryCarouselPane, so they follow the selected layout (capsule/hero/
  list/carousel) and match the rest of the library.
- Tapping a card opens RecommendedGameScreen (via the shared detail pane)
  instead of launching the store link directly. LibraryDetailPane builds
  the RecommendedGame from the tapped GOG rec (description/hero/release
  date enriched from api.gog.com), falling back to the daily rec.
- Developer from api.gog.com/v2/games, review score+count from
  reviews.gog.com averageRating (value*20), fetched in parallel with the
  product detail.
- VideoHero now plays YouTube trailers (which is all GOG provides) via a
  muted autoplay WebView, keeping ExoPlayer for direct-URL videos.
  GOG rec detail now passes the YouTube embed as videoUrl.
The rec ViewModel now fetches per-game compatibility (name-keyed, cache-first
then batched via GameCompatibilityService) and pulls device/GPU run stats from
the caches. Since recs are GOG-source but community stats mostly live under
other sources, each name is looked up across all sources and re-keyed under
GOG so LibraryState.statsFor resolves. Passed into the rec LibraryState so the
native cards render the same compatibility badge and stats overlay as the library.
- The Recommended tab now renders the recommended star (Icons.Rounded.Star)
  instead of a text label, in both compact and expanded tab bars.
- visibleEntries drops the Recommended tab when PrefManager.showRecommendations
  is off, so it stays hidden (and out of L1/R1 cycling) with the preference.
…trols

- Tags from api.gog.com/v2 (_embedded.tags); description now uses the full
  body (was showing only the short lead, hence 'truncated'); developer + tags
  from one v2 fetch.
- Media carousel: swipeable pager over all videos + screenshots (was only the
  first video), with a page counter; video pages play only when active.
- Hide YouTube controls via a pointer-blocking overlay + iv_load_policy=3.
- Surface 'Because you played X' on the detail screen.
- Description now uses gamesdb's plain-text 'summary' (clean one-paragraph),
  falling back to the stripped GOG HTML only if summary is missing.
- YouTube trailer now uses the IFrame Player API with controls:0 (genuinely
  chromeless: no control bar or title) and programmatic muted autoplay,
  instead of the raw embed. No cropping.
Grid cards for recommendations now show the GOG review score as a rating pill
top-left (reclaiming the redundant 'Recommended' badge), the discount top-right
(reclaiming the source-icon slot), and the price in place of the perf-stats row.
Ratings are fetched (reviews.gog.com averageRating) for the top 60 ranked recs
in parallel and cached. Price/discount come from purchased_together.
…adge

- Restore the perf-stats row on recommendation cards (compatibility/how-it-runs
  is important) instead of replacing it with price.
- Price line under the title now shows final price + struck-through original +
  discount %.
- Top-right shows a 'matches N of your games' badge (upvote arrow + count),
  only when a rec is seeded by 2+ of the user's games.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8967333f-92cb-4661-b583-5f412c26b857

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/gog-recommendations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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