0.4.0 - translations, download fallback, android auto, radio, infinite flow, bugfixes
This commit is contained in:
parent
a5381f0fed
commit
e984621eeb
88 changed files with 2911 additions and 379 deletions
|
|
@ -20,6 +20,7 @@ class DeezerAPI {
|
|||
|
||||
String token;
|
||||
String userId;
|
||||
String userName;
|
||||
String favoritesPlaylistId;
|
||||
String privateUrl = 'http://www.deezer.com/ajax/gw-light.php';
|
||||
Map<String, String> headers = {
|
||||
|
|
@ -95,6 +96,7 @@ class DeezerAPI {
|
|||
} else {
|
||||
this.token = data['results']['checkForm'];
|
||||
this.userId = data['results']['USER']['USER_ID'].toString();
|
||||
this.userName = data['results']['USER']['BLOG_NAME'];
|
||||
this.favoritesPlaylistId = data['results']['USER']['LOVEDTRACKS_ID'];
|
||||
return true;
|
||||
}
|
||||
|
|
@ -384,5 +386,20 @@ class DeezerAPI {
|
|||
|
||||
return data['results']['data'].map<Album>((a) => Album.fromPrivateJson(a)).toList();
|
||||
}
|
||||
|
||||
Future<List> searchSuggestions(String query) async {
|
||||
Map data = await callApi('search_getSuggestedQueries', params: {
|
||||
'QUERY': query
|
||||
});
|
||||
return data['results']['SUGGESTION'].map((s) => s['QUERY']).toList();
|
||||
}
|
||||
|
||||
//Get smart radio for artist id
|
||||
Future<List<Track>> smartRadio(String artistId) async {
|
||||
Map data = await callApi('smart.getSmartRadio', params: {
|
||||
'art_id': int.parse(artistId)
|
||||
});
|
||||
return data['results']['data'].map<Track>((t) => Track.fromPrivateJson(t)).toList();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue