audiobookshelf-flutter / audiobookshelf_api Goto Github PK
View Code? Open in Web Editor NEWA Dart wrapper for the audiobookshelf API.
Home Page: https://pub.dev/packages/audiobookshelf_api
License: GNU General Public License v3.0
A Dart wrapper for the audiobookshelf API.
Home Page: https://pub.dev/packages/audiobookshelf_api
License: GNU General Public License v3.0
The app should use the api package instead of including it as a sub project.
Add all the cache endpoints to the cache service.
Add all the filesystem endpoints to the filesystem service.
Add all the me endpoints to the me service.
Add all the backups endpoints to the backups service.
Add server endpoints to server service.
class LibrarySearchResponse with _$LibrarySearchResponse {
const factory LibrarySearchResponse.book({
required LibraryItemSearchResult book,
required List<String> tags,
required List<Author> authors,
required List<Series> series,
}) = BookLibrarySearchResponse;
const factory LibrarySearchResponse.podcast({
required LibraryItemSearchResult podcast,
required List<String> tags,
required List<Author> authors,
required List<Series> series,
}) = PodcastLibrarySearchResponse;
factory LibrarySearchResponse.fromJson(Map<String, dynamic> json) =>
LibrarySearchResponseConverter().fromJson(json);
}
class LibrarySearchResponse with _$LibrarySearchResponse {
const factory LibrarySearchResponse.book({
required List<LibraryItemSearchResult> book,
required List<String> tags,
required List<Author> authors,
required List<Series> series,
}) = BookLibrarySearchResponse;
const factory LibrarySearchResponse.podcast({
required LibraryItemSearchResult podcast,
required List<String> tags,
required List<Author> authors,
required List<Series> series,
}) = PodcastLibrarySearchResponse;
factory LibrarySearchResponse.fromJson(Map<String, dynamic> json) =>
LibrarySearchResponseConverter().fromJson(json);
}
Add all the notifications endpoints to the notifications service.
I think this package is just about ready for publishing. Here are the final tasks that I've thought of. I'll add any others that are suggested.
Add all the authors endpoints to the authors service.
I'm thinking about removing ResponseErrorHandler
and it's corresponding function arguments that are in every endpoint, stemming from AudiobookshelfApi.requestJson()
. This would also make the return types of those functions non-nullable.
The original idea of ResponseErrorHandler
was to provide a place where the caller could have access to the original http.Response
when doing JSON conversion and something went wrong. An alternative solution for this is to catch all throws from fromJson()
, wrap it in a new error type that also includes the http.Response
, and throw that.
@keaganhilliard, I would like your thoughts on this.
Add all the misc endpoints to the misc service.
Fun fact about http calls in dart. They will fail if pass anything other than a string or list of strings into the query parameters.
class BoolBinaryConverter implements JsonConverter<bool, int> {
const BoolBinaryConverter();
@override
bool fromJson(int json) => json == 1;
@override
int toJson(bool object) => object ? 1 : 0;
}
This causes items.get
requests to fail. To use this in a query parameter it has to either be '1' or '0'. So you could potentially explicitly call toString() on any parameters or coerce parameter attributes to strings.
Add all the sessions endpoints to the sessions service.
I would like to restructure the package so that it works similar to the GitHub Dart package. See this file for reference. Essentially, I want to break up each part of the API into its own "service". So for example, to get all libraries, you would do api.libraries.getAll()
.
Add all the tools endpoints to the tools service.
Make sure everything that should be public is exported in lib/audiobookshelf_api.dart
. Rework the exports so that each folder in src/models
has a file that exports everything in that folder.
Add all the podcasts endpoints to the podcasts service.
Add all the playlists endpoints to the playlists service.
Add all the collections endpoints to the collections service.
Add all the search endpoints to the search service.
Add all the libraries endpoints to the libraries service.
Add all the library items endpoints to the items service.
Add all the schemas from the docs.
Add all the series endpoints to the series service.
Add all the users endpoints to the users service.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.