public async void UploadContentCreatorCover(string path, int idContentCreator) { var channel = new Channel(Configuration.URIGrpcServer, ChannelCredentials.Insecure); var client = new Portadas.PortadasClient(channel); var call = client.SubirPortadaCreadorDeContenido(); for (var i = 1; i <= TryNumbres; i++) { try { var response = await UploadCover(path, idContentCreator, call); if (response.Error == Error.TokenInvalido || response.Error == Error.TokenFaltante) { await ApiServiceLogin.GetServiceLogin().ReLogin(); } else if (response.Error == Error.Ninguno) { break; } else { ErrorHandlerUploadCover(response); } } catch (RpcException ex) { throw new RpcException(ex.Status, ex.Message); } } }
public async Task <MemoryStream> GetAlbumCover(int idAlbum, Calidad calidad) { var channel = new Channel(Configuration.URIGrpcServer, ChannelCredentials.Insecure); var client = new Portadas.PortadasClient(channel); var request = CreateSolicitudObtenerPortada(idAlbum, ApiServiceLogin.GetServiceLogin().GetAccessToken(), calidad); var call = client.ObtenerPortadaAlbum(request); MemoryStream cover = null; for (var i = 1; i <= TryNumbres; i++) { try { cover = await GetCover(call); break; } catch (RpcException ex) { throw new RpcException(ex.Status, ex.Message); } }