fix: resolve Series deserialization issues and add author sorting

- 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.
This commit is contained in:
Claude 2025-11-20 16:17:09 +00:00
parent 5afce16532
commit f60ea72659
No known key found for this signature in database
3 changed files with 72 additions and 39 deletions

View file

@ -25,6 +25,10 @@ class LibraryAuthorsPage extends HookConsumerWidget {
);
}
// Sort authors alphabetically by name
final sortedAuthors = List<Author>.from(authors)
..sort((a, b) => a.name.toLowerCase().compareTo(b.name.toLowerCase()));
return GridView.builder(
padding: const EdgeInsets.all(16),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
@ -33,9 +37,9 @@ class LibraryAuthorsPage extends HookConsumerWidget {
crossAxisSpacing: 16,
mainAxisSpacing: 16,
),
itemCount: authors.length,
itemCount: sortedAuthors.length,
itemBuilder: (context, index) {
final author = authors[index];
final author = sortedAuthors[index];
return AuthorCard(author: author);
},
);