Add "dislike" button

This commit is contained in:
kilowatt 2020-10-21 22:35:54 +03:00
parent df3b7d3d63
commit 00c1fe1893
2 changed files with 14 additions and 0 deletions

View File

@ -199,6 +199,11 @@ class DeezerAPI {
await callApi('artist.deleteFavorite', params: {'ART_ID': id});
}
// Mark track as disliked
Future dislikeTrack(String id) async {
await callApi('favorite_dislike.add', params: {'ID': id, 'TYPE': 'song'});
}
//Add tracks to playlist
Future addToPlaylist(String trackId, String playlistId, {int offset = -1}) async {
await callApi('playlist.addSongs', params: {

View File

@ -317,6 +317,15 @@ class _PlayerScreenVerticalState extends State<PlayerScreenVertical> {
),
),
),
IconButton(
icon: Icon(Icons.sentiment_very_dissatisfied, size: ScreenUtil().setWidth(46)),
onPressed: () async {
await deezerAPI.dislikeTrack(AudioService.currentMediaItem.id);
if (playerHelper.queueIndex < (AudioService.queue??[]).length - 1) {
AudioService.skipToNext();
}
}
),
IconButton(
icon: Icon(Icons.more_vert, size: ScreenUtil().setWidth(46)),
onPressed: () {