Skip to content

Usage of ABS API #35

@Vito0912

Description

@Vito0912

Hello,

I am a contributor of ABS (but not maintainer!) and check third party clients for their API usage as in history there were many bugs with stats, playback, permissions etc. which caused loss of e.g. stats, and caused requests and issues on the ABS Discord and GitHub. I try to make this for every new (or app I add to my collection of apps) app I see and try to give them some recommendations of the API, as the API docs are not maintained at the moment, so often it's not even knowable what is right. Most of the apps I send this issue are new, so don't take this as bad critisim, but a hint.
I also started a "database" to collect all clients, list their features and rate their API usage. As I like ABS myself, built a client, SDK and OpenAPI spec myself, I want to give a detailed feedback on what an app can do better in terms of Usage with ABS. All of this ofc. is just a recommendation

Note

This does not mean you have to implement that this way, this is just note that it was intended that way so either these endpoints become deprecated in the future or problems can occur with using these methods. You can ofc also leave it the way it is currently.
This should be NOT a bad criticism. As said I try to give feedback in that matter to any app.

Playing a file

With the newer ABS versions there is a more secure way of playing files that don't need the token to be transmitted to request the files. You can check the web client or offical apps to see how it's done. The old api endpoint likely will not be removed any time soon, but the new one is more secure.

Syncing

You currently send the /sync request and the /progress request at the same time. The /sync already does update the progress (and is the proper, correct one). Sending both can cause race conditions where people have a item stuck in continue listening. With newer ABS versions this automatically gets fixed on ABS server restarts.
/progress should only be used to change progress from the UI (e.g. when a user would discharge progress, mark an item as finished or set a custom progress). The /progress does not trigger a websocket, so all clients using websockets do not get the progress change.

Note

Everything from now on is not bad usage but just things I noticed and I personally think are bad practice

Usage of items

Also you load all (no pagination) items from a server. Many people have libraries with 500-1000, but also 10000+ books. Loading the whole library takes time, RAM and performance of the server.

Note that this is a template I use mostly for mobile apps. So data usage and speed is more of an concern there. For an desktop I still don't think it's good, but not as bad. But I want to provide each app equal information.

I hope this helps you building a great and awesome ABS client!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions