Implement infinite scroll pagination for albums#12
Draft
Conversation
Co-authored-by: adrianstevens <5965865+adrianstevens@users.noreply.github.com>
Co-authored-by: adrianstevens <5965865+adrianstevens@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add infinite scroll pagination for albums
Implement infinite scroll pagination for albums
Dec 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Albums were loading with a hard-coded limit (previously 50, then 5000), preventing users with large libraries from accessing all their content. This implements infinite scroll pagination with server-side sorting.
Changes
API Layer (
IJellyfinApiService,JellyfinApiService)GetAlbumsPagedAsync(libraryId, startIndex, limit, sortBy, sortOrder)returning(List<Album>, int TotalCount)StartIndex,Limit,SortBy,SortOrderquery parametersViewModel (
LibraryViewModel)_albumsStartIndex,_totalAlbumCount,AlbumsPageSize=50HasMoreAlbumscomputed property,IsLoadingMoreAlbumsfor loading stateLoadMoreAlbumsCommandappends next page to existing collectionLoadAlbumsAsyncresets pagination on artist/sort changesSortName/ProductionYear/IsFavoritemapped from UI sort statusUI (
AlbumsListView)LoadMoreAlbumsCommandwhen within 200px of bottomArtist-specific albums still load all at once (typically small sets).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
av-build-tel-api-v1.avaloniaui.net/usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Summary
Implement infinite scroll pagination for albums to replace the current hard-coded limit of 50 albums.
Current Problem
In
JellyFinApiService.cs, theGetAlbumsAsyncmethod has a hard-codedLimit=50which only loads 50 albums at startup, even if the user has hundreds or thousands of albums in their library.Implementation Requirements
1. API Service Changes (
JellyFinApiService.cs)Add a new paginated method to the API service:
Don't forget to add this to the
IJellyfinApiServiceinterface as well.2. ViewModel Changes (
LibraryViewModel.cs)Add pagination state and commands:
Modify
LoadAlbumsAsyncto:Add
LoadMoreAlbumsAsyncmethod:_albumsStartIndexby page sizeAlbumscollection (don't replace)3. UI Changes (
AlbumsListView.axamlandAlbumsListView.axaml.cs)Add scroll detection to trigger loading more albums when user scrolls near the bottom:
In the XAML, give the ListBox a name and add a loading indicator:
In the code-behind, add scroll detection:
4. Sorting Considerations
When sorting is applied, you have two options:
SortByandSortOrderquery parameters (e.g.,SortBy=Name&SortOrder=Ascending)For simplicity and consistency, consider using server-side sorting by adding SortBy parameters to the API call:
SortBy=Namefor A-ZSortBy=ProductionYear&SortOrder=Descendingfor BY RELEASE YEARSortBy=IsFavorite&SortOrder=Descendingfor BY RATING (if supported)5. Edge Cases to Handle
IsLoadingMoreAlbumsflag)GetAlbumsByArtistAsyncis called (artist selected) - this probably doesn't need pagination as artists typically have fewer albumsAlbumCountdisplay to show "X of Y ALBUMS" or similar to indicate more are availableExpected Outcome
This pull request was created as a result of the following prompt from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.