public async Task GetArtistProfileCommandAsync(string artistName) { ArtistProfile artistProfile = await _lastFmService.GetArtistInfoAsync(artistName); _commandWebsocketService.SendCommandAsync("artist " + artistName, Context.User.Username); await ReplyAsync($"[{artistProfile.Name}] {artistProfile.Bio.Summary}"); }
public async Task <IActionResult> Register([FromBody] UserDTO userDTO) { var location = GetControllerActionNames(); try { var username = userDTO.EmailAddress; var password = userDTO.Password; _logger.LogInfo($"{location}: Registration Attempt for {username} "); var user = new ApplicationUser { Email = username, UserName = username }; var result = await _userManager.CreateAsync(user, password); if (!result.Succeeded) { foreach (var error in result.Errors) { _logger.LogError($"{location}: {error.Code} {error.Description}"); } return(InternalError($"{location}: {username} User Registration Attempt Failed")); } await _userManager.AddToRoleAsync(user, "Customer"); var ap = new ArtistProfile() { Id = Guid.NewGuid(), UserId = user.Id }; await _offerRepository.CreateArtistProfile(ap); return(Created("login", new { result.Succeeded })); } catch (Exception e) { return(InternalError($"{location}: {e.Message} - {e.InnerException}")); } }
public async Task CreateArtistProfile(ArtistProfile profile) { await _db.Carts.AddAsync(profile); await Save(); }
public IActionResult Index() { var profile = new ArtistProfile(); profile.Slug = "no-futures"; profile.Name = "No Futures"; profile.City = "Collinsville"; profile.State = "IL"; profile.ImageFileUrl = "http://lorempixel.com/400/400/"; profile.Genres = new List <Genre> { new Genre { Name = "Punk", Slug = "punk" }, new Genre { Name = "Rock", Slug = "rock" }, new Genre { Name = "Pop Punk", Slug = "pop-punk" } }; profile.Tracks = new List <Track> { new Track { Title = "Title1", ReleaseDate = DateTime.Now, ReleaseTitle = "ReleaseTitle1", AudioFileUrl = "https://archive.org/download/PeterHernandezPodcastAudioPlaceholder/AudioPlaceholder.mp3", ImageFileUrl = "http://lorempixel.com/400/400/", Artist = profile }, new Track { Title = "Title2", ReleaseDate = DateTime.Now.AddDays(-1), ReleaseTitle = "ReleaseTitle2", AudioFileUrl = "https://archive.org/download/PeterHernandezPodcastAudioPlaceholder/AudioPlaceholder.mp3", ImageFileUrl = "http://lorempixel.com/400/400/", Artist = profile }, new Track { Title = "Title1", ReleaseDate = DateTime.Now.AddDays(-2), ReleaseTitle = "ReleaseTitle2", AudioFileUrl = "https://archive.org/download/PeterHernandezPodcastAudioPlaceholder/AudioPlaceholder.mp3", ImageFileUrl = "http://lorempixel.com/400/400/", Artist = profile } }; return(View(profile)); }
public IEnumerable <Task <DownloadedImage> > DownloadThumbnailsArtistProfileAsync(ArtistProfile artistProfile, Func <IllustrationThumbnail, string> description, IEnumerable <int> thumbnailNumbers = null, int?maxPages = null) { if (thumbnailNumbers == null) { thumbnailNumbers = Enumerable.Range(0, artistProfile.Illustrations.Count); } if (maxPages.HasValue) { thumbnailNumbers = thumbnailNumbers.Take(maxPages.Value); } var artistUrl = artistProfile.Url; if (!thumbnailNumbers.Any()) { return(Enumerable.Empty <Task <DownloadedImage> >()); } return(thumbnailNumbers .Select((page) => { return DownloadToMemoryAsync(artistProfile.Illustrations.ElementAt(page).Value, artistUrl, description); //please fix this code })); }