Skip to content

Conversation

@CollotsSpot
Copy link

This adds the navigation for authors, genres and series tabs

This commit implements a comprehensive library browsing feature:

- Add LibraryBrowserProvider with providers for authors, genres, and series data
- Create LibraryAuthorsPage with grid view of authors including images and book counts
- Create LibraryGenresPage with list view of all genres
- Create LibrarySeriesPage with list view of series and book counts
- Update LibraryBrowserPage navigation to route to the new views
- Add routes for /browser/authors, /browser/genres, and /browser/series
- Replace "Not Implemented" toasts with functional navigation

The implementation uses the Audiobookshelf API via shelfsdk to fetch:
- Authors list with metadata (getAuthors)
- Genres from library filter data (getFilterData)
- Series with pagination support (getSeries)

All views follow Material Design 3 patterns and include proper loading/error states.
This workflow automatically builds APKs for feature branches:

- Triggers on pushes to branches starting with 'claude/', 'feature/', or 'dev/'
- Runs build_runner to generate required .g.dart files
- Supports both signed (if secrets available) and debug builds
- Uploads APK artifacts with branch name and commit SHA
- 30-day artifact retention for testing
- Manual trigger support via workflow_dispatch

This allows developers to test changes without manually building locally.
Artifacts can be downloaded from the GitHub Actions run page.
- Remove unused page and limit parameters from librarySeries provider
- Update library_series_page to call provider without parentheses
- Fix riverpod_generator compatibility issue
Fix compilation errors in library browser views:
- Use serverUrl instead of url on AudiobookShelfServer model
- Use authToken instead of token on AuthenticatedUser model
- Add all required variant handlers to Series.maybeMap call

These changes align with the actual model definitions in the codebase.
Add step to create and set permissions for ~/.config/.android directory
to fix 'Unable to create debug keystore' error during debug APK builds.
The directory is created by the SDK license step with sudo, so we need
sudo to change its permissions. This fixes the "Operation not permitted"
error during the workflow run.
Move the directory creation before the SDK license acceptance step to
avoid permission issues. The directory will be created with normal user
permissions, preventing the "Operation not permitted" errors when the
SDK manager (running with sudo) tries to use it.
- Fix genres error by parsing JSON manually to avoid Series deserialization
- Fix series blank screen by using SimpleSeries class instead of full Series
- Add alphabetical sorting to authors page
- Work around shelfsdk Series variant detection issues

The Audiobookshelf API returns Series objects that don't match any of the
variant detection patterns in the shelfsdk SeriesConverter. Since we can't
modify the external shelfsdk, we parse the API responses manually to extract
only the data we need for display.
- Sort authors by surname (last word in name) instead of first name
- Create FilteredLibraryItemsPage to display books filtered by author/genre/series
- Add navigation from authors/genres/series pages to filtered book lists
- Use AuthorFilter, GenreFilter, and SeriesFilter from shelfsdk
- Add libraryFiltered route with filter parameter support

Users can now:
- Browse authors sorted by surname
- Tap on an author to see all their books
- Tap on a genre to see all books in that genre
- Tap on a series to see all books in that series
- Add shelfsdk import to router.dart for Filter types
- Fix Media and MediaMetadata type checking using freezed mapOrNull
- Handle all Media variants (book, bookMinified, bookExpanded)
- Handle all MediaMetadata variants to extract title, subtitle, and authors
- Fix BookMetadata accessing authors list instead of authorName property

Resolves compilation errors in GitHub Actions build.
Add non-null assertion operators for authorName and subtitle in Text
widgets where null checks are already performed. This resolves the
null safety compilation errors.
- Try filterdata endpoint first (like genres)
- Fall back to series endpoint if needed
- Make SimpleSeries.fromJson more robust with multiple field name attempts
- Add extensive logging to debug series loading issues
- Change from ListView to GridView with 3 columns for better book browsing
- Redesign LibraryItemCard as grid cards with cover images and metadata
- Fix navigation to use Routes.libraryItem instead of Routes.you
- Use correct path parameter 'itemId' for book detail navigation
- Remove subtitle from cards to simplify grid layout
- Books now open properly when tapped, same as home page
Navigation fixes:
- Change goNamed to pushNamed in all library browser pages
- Maintains proper back navigation stack
- Back button now goes step by step instead of to beginning
- Prevents app from closing when navigating back from book detail

Grid layout fixes:
- Book covers are now always square (1.0 aspect ratio)
- Overall card aspect ratio is 0.75 to provide space for text
- Wrap cover in AspectRatio widget instead of using Expanded
- Ensures title and author info always visible below covers
- Fixes issue where book info was missing in series view
- Change childAspectRatio from 0.75 to 0.68 for more vertical space
- Fixes 'bottom overflowed by X pixels' error in grid cards
- Provides adequate space for square cover + title + author text
- Cards are slightly taller but layout is now correct
- Change childAspectRatio from 0.68 to 0.65
- Fixes 3.3 pixel overflow when titles span two lines
- Single-line titles already worked, this ensures two-line titles fit
Series sorting fix:
- Detect SeriesFilter and use 'sequence' sort parameter
- Other filters (author/genre) continue using alphabetical title sort
- Books in series now display in proper sequence order

Series metadata debugging:
- Add logging to show media and metadata variants for each item
- Add bookSeriesFilter metadata variant handlers
- Log extracted title and author for debugging
- This will help identify why series-filtered books show no info

The logging will show what metadata structure the API returns for
series-filtered items so we can properly extract title/author data.
Added minified: false to GetLibrarysItemsReqParams to ensure the API
returns complete book metadata including titles and authors. The logs
showed that series-filtered items were returning bookMinified variant
with empty title and null authorName fields. This change requests the
full metadata variant which includes all necessary fields.
Added performance optimizations to all library browser views:

- Added cacheExtent: 500 to all GridView/ListView builders to pre-render
  items and reduce stuttering during scrolling
- Wrapped grid items in RepaintBoundary to isolate repaints and improve
  performance
- Optimized CachedNetworkImage with:
  - fadeInDuration/fadeOutDuration: Duration.zero to remove animation overhead
  - memCacheHeight: 300 to limit in-memory cache size
  - maxHeightDiskCache: 600 to resize images for better performance

These changes should significantly reduce the stuttering observed when
scrolling the authors grid and filtering books, especially on first load.
@Dr-Blank
Copy link
Owner

Thanks for the PR 🙂, I will review it soon.

@Dr-Blank Dr-Blank self-requested a review November 26, 2025 06:41
@Dr-Blank Dr-Blank self-assigned this Nov 26, 2025
@Dr-Blank Dr-Blank added enhancement New feature or request ui changes in ui labels Nov 26, 2025
@CollotsSpot CollotsSpot closed this by deleting the head repository Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ui changes in ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants