fix(innertube): use musicAnimatedThumbnailRenderer backup for video covers#4081
fix(innertube): use musicAnimatedThumbnailRenderer backup for video covers#4081kairosci wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughAdds a ChangesThumbnail Extraction Refactor
Estimated code review effort: 2 (Simple) | ~12 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@innertube/src/main/kotlin/com/metrolist/innertube/pages/HistoryPage.kt`:
- Line 63: The `ThumbnailRenderer` model has a serial name collision because
`musicThumbnailRenderer` is aliased to `croppedSquareThumbnailRenderer`, which
conflicts with another property using the same effective serialized name. Update
the serialization mapping in the `ThumbnailRenderer` class by removing that
alias or renaming the conflicting property so each field has a unique serial
name and decoding can succeed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 453d35d2-54e6-42d3-9cff-b15381971170
📒 Files selected for processing (16)
innertube/src/main/kotlin/com/metrolist/innertube/YouTube.ktinnertube/src/main/kotlin/com/metrolist/innertube/models/ThumbnailRenderer.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/AlbumPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/ArtistItemsPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/ArtistPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/HistoryPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/HomePage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/LibraryAlbumsPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/LibraryPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/NewReleaseAlbumPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/PlaylistPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/PodcastPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/RelatedPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/SearchPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/SearchSuggestionPage.ktinnertube/src/main/kotlin/com/metrolist/innertube/pages/SearchSummaryPage.kt
Problem
Video covers served exclusively as animated thumbnails were rendered without a visible cover image throughout the app.
Cause
The ThumbnailRenderer data class parsed musicAnimatedThumbnailRenderer from the YouTube Music API response, but this field was never consulted when resolving thumbnail URLs. Every call site accessed only musicThumbnailRenderer, so animated thumbnails with no static equivalent were silently dropped.
Solution
This commit adds a top-level getThumbnailUrl() function to ThumbnailRenderer that falls through musicThumbnailRenderer, then musicAnimatedThumbnailRenderer.backupRenderer, then croppedSquareThumbnailRenderer. All seventy-seven existing call sites have been migrated from the manual musicThumbnailRenderer?.getThumbnailUrl() pattern to the new unified method, ensuring that the YouTube-provided static fallback inside animated thumbnails is always used.
Testing
Verified that thumbnail images now appear for previously broken video covers across home, library, search, history, album, playlist, podcast, artist, and related content pages.
Related Issues
Closes #4033
Summary by CodeRabbit