private async void LoadSongById(int songId) { await SubsonicService.GetSong(songId) .WithErrorHandler(this) .OnSuccess(song => Handle(new PlayFile { Model = song })) .Execute(); }
private async Task <Client.Common.Models.PlaylistItem> LoadModelImpl(IId model) { Client.Common.Models.PlaylistItem playlistItem = null; if (model != null) { await SubsonicService.GetSong(model.Id) .WithErrorHandler(this) .OnSuccess(result => playlistItem = CreatePlaylistItemFromSong(result)).Execute(); } return(playlistItem); }
public async Task <IActionResult> GetSong(SubsonicRequest request) { var authResult = await AuthenticateUser(request).ConfigureAwait(false); if (authResult != null) { return(authResult); } var result = await SubsonicService.GetSong(request, SubsonicUser).ConfigureAwait(false); return(BuildResponse(request, result, "song")); }