This commit is contained in:
Steven Hildreth 2019-01-13 16:37:17 -06:00
parent 6c23634b2f
commit 2334e0840f
4 changed files with 21 additions and 9 deletions

View file

@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using RestSharp;
using RestSharp;
using Roadie.Library.SearchEngines.MetaData;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Roadie.Library.SearchEngines.Imaging
{
@ -10,8 +10,11 @@ namespace Roadie.Library.SearchEngines.Imaging
bool IsEnabled { get; }
RestRequest BuildRequest(string query, int resultsCount);
Task<OperationResult<IEnumerable<ArtistSearchResult>>> PerformArtistSearch(string query, int resultsCount);
Task<IEnumerable<ImageSearchResult>> PerformImageSearch(string query, int resultsCount);
Task<OperationResult<IEnumerable<ReleaseSearchResult>>> PerformReleaseSearch(string artistName, string query, int resultsCount);
}
}

View file

@ -99,7 +99,8 @@ namespace Roadie.Library.SearchEngines.Imaging
};
}
#pragma warning disable CS1998
#pragma warning disable CS1998
public override async Task<IEnumerable<ImageSearchResult>> PerformImageSearch(string query, int resultsCount)
{
var request = this.BuildRequest(query, resultsCount);

View file

@ -87,9 +87,17 @@ namespace Roadie.Api.Controllers
this.Logger.LogInformation($"Successfully authenticated User [{ model.Username}]");
if(!user.EmailConfirmed)
{
var code = await this.UserManager.GenerateEmailConfirmationTokenAsync(user);
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, Request.Scheme);
await this.EmailSender.SendEmailAsync(user.Email, $"Confirm your { this.RoadieSettings.SiteName } email", $"Please confirm your { this.RoadieSettings.SiteName } account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
try
{
var code = await this.UserManager.GenerateEmailConfirmationTokenAsync(user);
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, Request.Scheme);
await this.EmailSender.SendEmailAsync(user.Email, $"Confirm your { this.RoadieSettings.SiteName } email", $"Please confirm your { this.RoadieSettings.SiteName } account by <a href='{HtmlEncoder.Default.Encode(callbackUrl)}'>clicking here</a>.");
}
catch (Exception ex)
{
this.Logger.LogError(ex, "Error sending confirmation Email");
}
}
this.CacheManager.ClearRegion(EntityControllerBase.ControllerCacheRegionUrn);
var avatarUrl = $"{ this.RoadieHttpContext.ImageBaseUrl }/user/{ user.RoadieId }/{ this.RoadieSettings.ThumbnailImageSize.Width }/{ this.RoadieSettings.ThumbnailImageSize.Height }";
@ -106,7 +114,7 @@ namespace Roadie.Api.Controllers
}
catch (Exception ex)
{
this.Logger.LogError(ex, "Eror in CreateToken");
this.Logger.LogError(ex, "Error in CreateToken");
return BadRequest();
}
}

View file

@ -3,7 +3,7 @@
"Roadie.Api": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5123/"
}