Merge branch 'feature/dislike' of kilowatt36/freezer into master

This commit is contained in:
exttex 2020-11-01 15:31:01 +00:00 committed by Gogs
commit 39364f037e
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: () {