public override async Task ChildClick(ItemClickEventArgs eventArgs) { var subsonicModel = ((MenuItemViewModel)eventArgs.ClickedItem).Item; await SubsonicService.GetPlaylist(subsonicModel.Id) .WithErrorHandler(ErrorHandler) .OnSuccess(LoadPlaylist) .Execute(); }
public async Task <IActionResult> GetPlaylist(SubsonicRequest request) { var authResult = await AuthenticateUser(request).ConfigureAwait(false); if (authResult != null) { return(authResult); } var result = await SubsonicService.GetPlaylist(request, SubsonicUser).ConfigureAwait(false); return(BuildResponse(request, result, "playlist")); }
public async Task Save() { CanEdit = false; var existingEntry = MenuItems.FirstOrDefault(item => item.Item.Name == PlaylistName); if (existingEntry != null) { await SubsonicService.GetPlaylist(existingEntry.Item.Id) .WithErrorHandler(ErrorHandler) .OnSuccess(async result => await UpdatePlaylist(result)) .Execute(); } else { var songIds = GetSongIdsForActivePlaylist(); await SubsonicService.CreatePlaylist(PlaylistName, songIds) .WithErrorHandler(ErrorHandler) .OnSuccess(OnSaveFinished) .Execute(); } }