fix(android-auto): paginate large libraries and add Browse-by-Letter#1579
fix(android-auto): paginate large libraries and add Browse-by-Letter#1579pdebuitlear wants to merge 11 commits intoUnicornsOnLSD:redesignfrom
Conversation
Fixes UnicornsOnLSD#1576 Returning entire album/artist collections in a single Android Auto getChildren response causes a FAILED BINDER TRANSACTION crash due to the ~1MB Binder IPC buffer limit. This replaces the unbounded fetch with a 200-item paginated approach and adds a Browse-by-Letter hybrid for navigating large libraries by initial letter. Changes: - Limit root collection responses to 200 items per page; append a "More… (N remaining)" browse node when further pages exist - Add a "Browse by Letter" node at the top of page 1 for Albums and Artists, opening an A–Z + # index; each letter page is independently paginated with its own "More…" node - Add nameFilter and pageStartIndex fields to MediaItemId (HiveFields 4 & 5) to encode browse state inside Android Auto node IDs - Add NameStartsWith query parameter to getItems, getArtists, and getAlbumArtists Jellyfin API calls for server-side letter filtering - Set CONTENT_STYLE_BROWSABLE_HINT=4 (category grid) on Albums and Artists root nodes to hint at non-alphabetical rendering - Add docs/android_auto_browsing.md with implementation notes and Android Auto platform learnings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a new private method that fetches up to 20 recently played albums or artists from Jellyfin (sorted by DatePlayed descending, filtered to IsPlayed), and wires it into getMediaItems() via a recentlyPlayed parentType dispatch branch. Offline mode returns a non-playable placeholder item. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Jellyfin's IsPlayed filter requires all tracks to have been played, which is far too strict for albums/artists. Sort by DatePlayed descending and filter client-side on userData.lastPlayedDate != null to match the pattern used elsewhere in the app.
|
@pdebuitlear thanks for the PR! I'm guessing this doesn't play well with the built-in letter selector of AA? If so, can we disable it (maybe you did that already)? |
Jellyfin only sets DatePlayed on track items, not on albums or artists. Query recently played tracks (Filters=IsPlayed works for tracks), deduplicate by albumId or albumArtist, then fetch the actual album/artist items by ID.
The built-in letter selector is problematic. From Claude: An alternative is the following: Letter-first navigation Advantages over current approach:
"More..." nodes within letter pages: Let me know what you want to do |
|
I skimmed over these, and there looks to be substantial duplication of changes/overlapping features between these four PRs. If the changes can't be cleanly separated, I'd personally prefer if they were all in one PR so I can just review everything in one place without any duplication. Also, the browse by letter and artist change from immediate playback to browsing seem like notable enough changes, with upsides and downsides for different library sizes and browsing habits, that I think keeping the original versions available behind a setting might be worthwhile. |
New consolidated PR here |
Summary
Fixes #1576
Returning entire album/artist collections in a single Android Auto
getChildrenresponse causes aFAILED BINDER TRANSACTIONcrash due to the ~1MB Binder IPC buffer limit. This PR fixes the crash and adds a Browse-by-Letter feature for navigating large libraries.NameStartsWithquery parameter togetItems,getArtists, andgetAlbumArtistsfor server-side letter filtering (the#bucket falls back to client-side filtering)nameFilter(HiveField 4) andpageStartIndex(HiveField 5) to encode browse state inside Android Auto node IDsdocs/android_auto_browsing.mdwith implementation notes and Android Auto platform learningsTest plan