subsonic_api

Creator: coderz1093

Last updated:

0 purchases

subsonic_api Image
subsonic_api Images

Languages

Categories

Add to Cart

Description:

subsonic api

SubSonic API Wrapper #
Package for interfacing with any SubSonic API compatible server.
Features #
- Fetch Artists and Albums from the server
copied to clipboard
Getting started #
Just add the package to your pubspec.yaml file:
dependencies:
subsonic_api: ^0.0.4
copied to clipboard
Then import the package in your Dart code:
import 'package:subsonic_wrapper/subsonic_api.dart' as subsonic;
copied to clipboard
Usage #
To use this package, you'd need to generate your authentication token and salt.
String salt = subsonic.createSalt();

String token = subsonic.createToken('password', salt);
copied to clipboard
this is the preffered way to generate the token and salt, since it doen't expose the password anywhere in the application.
Then, you need to create a SubSonicClient object with the server URL, username, token, salt, client name and version.

SubSonicClient client = SubSonicClient(
'http(s)://server(:port)',
'username',
token,
salt,
'Client Name',
'1.0.0'
);
copied to clipboard
After that, you can use the client to fetch data from the server.
Future<void> fetch() async {
SubSonicResponse response = await client.getArtists();
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.