/// <summary> /// Deletes the song from this playlist. /// </summary> /// <param name="song">Song to delete</param> /// <param name="onSuccess">On success</param> /// <param name="onFailure">On failure</param> /// <param name="onError">On error</param> public void DeleteSong(Song song, Action onSuccess, Action <NetworkResponse> onFailure, Action onError) { RestSharpTools.DeleteAsync("/playlist/" + PlaylistId + "/songs/" + song.SongId, null, (response) => { onSuccess(); }, onFailure, () => { Console.WriteLine("Exception@Playlist->DeleteSong()"); onError?.Invoke(); }); }
/// <summary> /// Deletes an account song. /// </summary> /// <param name="accountSong">Account song to delete</param> /// <param name="onSuccess">On success</param> /// <param name="onFailure">On failure</param> /// <param name="onError">On error</param> public void DeleteAccountSong(AccountSong accountSong, Action onSuccess, Action <NetworkResponse> onFailure, Action onError) { RestSharpTools.DeleteAsync("/account/" + AccountId + "/accountsong/" + accountSong.AccountSongId, null, (response) => { AccountSongs.Remove(accountSong); onSuccess?.Invoke(); }, onFailure, () => { Console.WriteLine("Exception@Account->DeleteAccountSong() -> "); onError?.Invoke(); }); }
/// <summary> /// Undislikes a song. /// </summary> /// <param name="song">Song to undislike</param> /// <param name="onSuccess">On success</param> /// <param name="onFailure">On failure</param> /// <param name="onError">On error</param> public void UndislikeSong(Song song, Action onSuccess, Action <NetworkResponse> onFailure, Action onError) { var data = new { account_id = AccountId }; RestSharpTools.DeleteAsync("/song/" + song.SongId + "/songdislike", data, (response) => { onSuccess(); }, onFailure, () => { Console.WriteLine("Exception@Account->DislikeSong()"); onError?.Invoke(); }); }