Found where we potentially are setting a new poster path, looks like the entity was being modified and being set as Tracked by entity framework, so the next time we called SaveChangesAsync() it would save the new posterpath on the entity.

This commit is contained in:
Jamie 2017-10-26 08:33:06 +01:00
parent 51c2e13e35
commit 20f3239b94
8 changed files with 51 additions and 15 deletions

View file

@ -144,7 +144,11 @@ namespace Ombi.Core.Engine
public async Task<IEnumerable<MovieRequests>> SearchMovieRequest(string search)
{
var allRequests = await MovieRepository.GetWithUser().ToListAsync();
var results = allRequests.Where(x => x.Title.Contains(search, CompareOptions.IgnoreCase));
var results = allRequests.Where(x => x.Title.Contains(search, CompareOptions.IgnoreCase)).ToList();
results.ForEach(x =>
{
x.PosterPath = PosterPathHelper.FixPosterPath(x.PosterPath);
});
return results;
}
@ -175,11 +179,6 @@ namespace Ombi.Core.Engine
};
}
/// <summary>
/// This is the method that is triggered by pressing Approve on the requests page
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<RequestEngineResult> ApproveMovie(MovieRequests request)
{
if (request == null)
@ -242,7 +241,7 @@ namespace Ombi.Core.Engine
results.IssueId = request.IssueId;
results.Issues = request.Issues;
results.Overview = request.Overview;
results.PosterPath = request.PosterPath;
results.PosterPath = PosterPathHelper.FixPosterPath(request.PosterPath);
results.QualityOverride = request.QualityOverride;
results.RootPathOverride = request.RootPathOverride;