Fixed #1583 you can now delete users.

Fixed the issue where the requested by was not showing.
Finally fixed the broken poster paths
This commit is contained in:
tidusjar 2017-10-20 22:07:30 +01:00
commit 1dc8eac035
27 changed files with 157 additions and 155 deletions

View file

@ -120,7 +120,10 @@ namespace Ombi.Core.Engine
public async Task<IEnumerable<MovieRequests>> GetRequests(int count, int position)
{
var allRequests = await MovieRepository.GetWithUser().Skip(position).Take(count).ToListAsync();
allRequests.ForEach(x => PosterPathHelper.FixPosterPath(x.PosterPath));
allRequests.ForEach(x =>
{
x.PosterPath = PosterPathHelper.FixPosterPath(x.PosterPath);
});
return allRequests;
}
@ -258,6 +261,11 @@ namespace Ombi.Core.Engine
await MovieRepository.Delete(request);
}
public async Task<bool> UserHasRequest(string userId)
{
return await MovieRepository.GetAll().AnyAsync(x => x.RequestedUserId == userId);
}
private async Task<RequestEngineResult> AddMovieRequest(MovieRequests model, string movieName)
{
await MovieRepository.Add(model);