mirror of
https://github.com/sphildreth/roadie
synced 2024-11-10 06:44:12 +00:00
Cleanup
This commit is contained in:
parent
6c23634b2f
commit
2334e0840f
4 changed files with 21 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"Roadie.Api": {
|
||||
"commandName": "Project",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Production"
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"applicationUrl": "http://localhost:5123/"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue